C++ Program to show Base of Number using setbase Manipulator Function
Code:
Sample Output:
Comment bellow for your Query and Feedback
Code:
/*C++ Program to show Base of Number using setbase Manipulator Function*/
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main(void)
{
int value;
clrscr();
cout<<"\nEnter the Value \n";
cin>>value;
cout<<"Decimal base " << setbase(10) << value << endl;
cout<<"Hexadecimaal base " << setbase(16) << value << endl;
cout<<"Octal base " << setbase(8) << value << endl;
getch();
}
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main(void)
{
int value;
clrscr();
cout<<"\nEnter the Value \n";
cin>>value;
cout<<"Decimal base " << setbase(10) << value << endl;
cout<<"Hexadecimaal base " << setbase(16) << value << endl;
cout<<"Octal base " << setbase(8) << value << endl;
getch();
}
Sample Output:
Comment bellow for your Query and Feedback
0 comments:
Confused? Feel free to ask
Post a Comment