I wrote the following code with an expectation that it output 211, but when I compile and run it, I see 137.
Could someone please explain what’s going on? Thanks.
#include <stdio.h>
int main()
{
int binary1,binary2;
binary1 = 0100;
binary2 = 0111;
printf("%d\n", binary1 + binary2);
return 0:
}
These are not binary numbers but octal (base 8):