This is my first question, so forgive me if I get something wrong.
I am very new to programming, and I came across a problem I can't find a solution to online. When using
There are different notations for the popular bases (base 8, 10 and 16).
Base 8: Also known as Octal. You define a number as base 8 when you put a 0 in front of the input number. So when you input
020, it is read as
Base 10: Also known as Decimal. You just write a number you want to input without any leading
0s. So when you input
20, it is read as
Base 16: Also known as Hexadecimal. You write it with an
0x in the front. So inputting
0x20, it will be stored as
32 in decimal.
If you are reading the number using
scanf() with format specifier as
%i, then it is reading an octal number and interpreting it as an integer.