Ary rule
Decimal |
1-9 starts with a normal number, such as 123 |
Octal |
0 begin with a number, such as 0123 |
Hex |
Beginning with 0x, such as 0X123 |
Binary |
C language written in a binary number can not be directly |
Case are as follows
int main () { int a; = 12 is A; // assign values in decimal //% d decimal way to print the printf ( " [10] A D =% \ n- ", A); // letter o% o octal way to print the printf ( " [. 8] a =% O \ n- ", a); //% X 18% X-printed in binary manner the printf ( " [16] a X =% \ n- ", a); = 0123 A; // octal manner assignment A = 0x1ab; // hexadecimal manner assignment // print slightly return 0; }