why the value of 010 is 8 in cpp or any coding language;

why the value of 010 is 8 in cpp or any coding language;

#include<iostream>
using namespace std;
int main()
{
int x=010;
cout<<x;
}

Output:

0         1         0         basically means octal number so lets convert it into binary form

000    001      000     now combining it:

000001000               it basically represnt 1000 in binary which in decimal represent 8



Related Posts:

0 comments: