PROGRAM
//Program to display Hexadecimal and Octal Equivalent of a given number
#include <iostream>
using namespace std;
int main()
{
int num;
cout << "ENTER NUMBER: ";
cin >> num;
cout<<"\n GIVEN NUMBER: "<< num;
cout << "\n HEXADECIMAL EQUIVALENT: "<< hex << num ;
cout << "\n OCTAL EQUIVALENT: "<< oct << num ;
return 0;
}
OUTPUT
//Program to display Hexadecimal and Octal Equivalent of a given number
#include <iostream>
using namespace std;
int main()
{
int num;
cout << "ENTER NUMBER: ";
cin >> num;
cout<<"\n GIVEN NUMBER: "<< num;
cout << "\n HEXADECIMAL EQUIVALENT: "<< hex << num ;
cout << "\n OCTAL EQUIVALENT: "<< oct << num ;
return 0;
}
OUTPUT
1 comments :
commentsHow to write a program to dispaly the value 10 in hexadecimal and octal equivalent with base indictor
Reply