cppoctdechex

Posted on February 12th, 2009 in Cpp by admin

Octal / Hexadecimal / Decimal conversion

#include <iostream.h>
#include <iomanip.h> int main()
{
cout<<”The decimal value of 15 is “<<15<<endl;
cout<<”The octal value of 15 is “<<setiosflags(ios::oct)<<15<<endl;
cout<<”The hex value of 15 is “<<setiosflags(ios::hex)<<15<<endl;

return 0;

}

Related posts:

  1. Write text to a file This example uses streams to write text to a file...

Related posts brought to you by Yet Another Related Posts Plugin.

Post a comment