1.

Format Specifier part2

Answer»

Format Specifier part2
As in part one i have SPECIFIED format specifier with some EXAMPLE and below are the left part for format specifier
(7)Use of %E in C program


Format Specifier %E
In above code output will be exponent part will be print and Exponentila is with capital E
Output:-
Exponential value of y is: 3.000000E+00


(8)Use of %g in C program


Format Specifier %g
In above code float value of y is display by using %g specifier. And %g will display the output same as the input with same precision.
Output:-
Float value of y is: 3.8


(9)Use of %p in C program


Format Specifier %p
In above code this will produce the hexadecimal form of some values
Output:-
Address value of y in hexadecimal form is: 0x7ffeb01a53ec


(10)Use of %c in C program


Format Specifier %c
In above code this will print value that CONVERT int value of char to ascii character.
Output:-
Value of a is: c


(11)Use of %s in C program


Format Specifier %s
In above code this will print value as string.
Output:-
CrackYourInterview


(12)Minimum Field Width Specifier


Format Specifier <klux>SPACE</klux>
In above code we use "%8d" specifier displays the value after 8 spaces while %-8d specifier will make a value left-aligned.
Output:-
900
900


(13)Field Empty Space


Format Specifier SpaceFill
In above code we will fill empty space with some other characters
Output:-
000000012


(14)Use of (Dot) operator


Format Specifier Dot
In above code we use dot operator with code
Output:-
12.20



Discussion

No Comment Found