Site icon DataFlair

C++ Program for Integer Representation

Master C++ with Real-time Projects and Kickstart Your Career Start Now!!

Program 1

#include<iostream>
using namespace std;
int main()
{
      int a;
      cout<<sizeof(a);
    //  int a=13;  // decimal number
    //  cout<<"\n Decimal : " << a;
    //  int b=013;   //octal number
    //      cout<<"\nOctal to Decimal : "<< b;  
    int c=0xface;  //hexadecimal
     cout<<"\n Hexadecimal to  Decimal: " << c;   // Decimal
    //  return 0;
}

 

Exit mobile version