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;
  }
Share on Google Plus