- int main(void)
- {
- int x=100;
- printf(“dec=%d; octal=%o; hex=%x\n”,x,x,x);
- printf(“dec=%d;octal=%#o;hex=%x\n”,x,x,x);
- return 0;
- }
why we add # into the formate specifier ……………….why compiler printing the same value 100 after using the same format specifier %d in all case………..
To print any values in decimal format/Octal format or in hexadecimal format we can implement both the printf statements however the only difference is while printing the second statement we get the output in a proper format about the formats usage in Compiler.