Why these 2 are giving different output:
int num=0,a;
cin>>a;
for(int i=0;a>0;i++)
{
num=num+((a%10)*pow(2,i));
a=a/10;
}
cout<<num;
int num=0,a;
a=010;
for(int i=0;a>0;i++)
{
num=num+((a%10)*pow(2,i));
a=a/10;
}
cout<<num;
for a=010???