Wednesday, February 7, 2018

Conversion specifiers in C Languages

Conversion specifiers in C Languages 

There is a specific set of conversion specifiers for printf and another specific set of conversion specifiers for scanf. You have to keep in mind that the conversion characters used for scanf are not the same as those used for printf. Hence, you have to be careful when using them in your program. See to it that you become familiar with the long types.

The following are the conversion specifiers for printf:-

You have to take note that the lowercase letter l may be used as a prefix for long types.

u – it means unsigned denary integer

d – it means signed denary integer

o – it means octal integer

x – it means hexadecimal integer

s – it means string

g – it means use e or f, whichever one is shorter

f – it means a fixed decimal floating point

c – it means a single character

e – it means scientific notation floating point

The following are the conversion specifiers for scanf: -

ld – it means long int

d – it means denary integer

o – it means octal integer

x – it means hexadecimal integer

f – it means float type

h – it means short integer

lf – it means double or long float

e – it means float type

c – it means single character

le – it means double

s – it means character string   READ MORE

0 comments:

Please comment and follow this site blog inbox