+ 1
write a program to find the octal & hexa decimal equivalent of the entered decimal no.
1 Answer
+ 1
#include <iostream>
# include <iomanip>
using namespace std;
int main() {
int num;
cin>>num;
cout<<"your number: "<<num<<endl;
cout<<"hex = "<<hex<<num<<endl;
cout<<"oct = "<<oct<<num<<endl;
return 0;
}
/*
use these headers:
#include <iostream>
# include <iomanip>
using namespace std;
then, in a cout statement, write hex or oct,
the next number after that will be written in hex or oct.
example
cout<<oct<<9; (writes 11, octal for nine)
int test = 15;
cout<<hex<<test; (writes f, hexa for 15)
*/
Hot today
I have made a calculator in which my % (Percentage) not work correctly for 100%50 or 100%20.
2 Votes
Python palindrome challenge.
1 Votes
Java
0 Votes
Number of Ones ( C++ ) question!
1 Votes