Write down the commonly used scanf format codes?

Last updated on June 13th, 2020 at 08:25 pm

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)

Leave a Reply

Your email address will not be published. Required fields are marked *