Why format specifier for integer is %d not %i in c programming language?
Have you ever wondered that format specifier written in c language like character type has %c ,float type has %f and string type has %s but integer type doesnt have %i instead it has its format specifier %d?
This is because integer is divided into subcategories decimal integer, binary integer,hexadecimal integer and octal integer and %d is used for decimal integer as its format specifier and the results we often want is of decimal type if we want our solution then different fomat specifier can be used to obtain the desired output
- %d - decimal integer
- %o - octal integer
- % x- hexadecimal integer
stay tuned to our blog for keep getting cool facts like this..
And please comment if you like this post
terrific work @ achal
ReplyDeletethanx..
ReplyDeletethanx..
ReplyDelete