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)

Author: Tanmay Chakrabarty

Tanmay Chakrabarty is a former CSE student, currently working as a Senior Software Engineer with 5+ years of experience in the field of Web Application development in PHP+MySQL platform with strong skills in Javascript, JQuery, JQuery UI and CSS. He tries to write notes every week but fails due to heavy loads of duty.

Recommended Recommends

Comments

Contact Us