Write down the commonly used scanf format codes?



Commonly used scanf format codes: 

In the following table the required format codes and their meanings are given.




Code
Meanings
%c
read a single character
%d
read a decimal integer
%e
read a floating point value
%f
read a floating point value
%g
read a floating point value
%h
read a short integer
%i
read decimal, hexadecimal or octal integer
%o
read an octal integer
%s
read a string
%u
read an unsigned decimal integer
%x
read a hexadecimal integer
%[....]
read a string of word(s)

Recommended Recommends

Comments

Contact Us