This code, when I run it on C++ Borland compiler 5.02
#include<iostream.h>
void main()
{
int x;
cin>>x;
cout << x;
}
When enter 0010
to x
, the output is 8
? And these for some entries that have zeroes on its left, but not all?
This code, when I run it on C++ Borland compiler 5.02
#include<iostream.h>
void main()
{
int x;
cin>>x;
cout << x;
}
When enter 0010
to x
, the output is 8
? And these for some entries that have zeroes on its left, but not all?
In C++:
0
.0x
.Therefore:
0x10
is a hexadecimal number representing 16.010
is an octal number representing 8.10
is a decimal number representing 10.