why we can not use it
{
k=b%10;
ans=ans+(2^i)k;
i++;
b=b/10;
}
instead of
k=b%10;
ans=ans+pk;
p=p*2;
b=b/10;
}
Regarding binary questiion
@kailash_01
^ is the bitwise XOR operator in C++ and it means something entirely else. If you wish to compute the ith power of 2 , you can compute it using the pow function - pow(2,i).