0
What is the use of format specifier? What is the need for the format specifier?
4 Respostas
+ 11
The format specifier are usually used during input and output in C. It tells the compiler what type of data is in a variable during taking input using scanf() or printing using printf(). To print formatted output or to take formatted input we need format specifiers.
If you want an integer variable then use %d, if a characyer then %c and the list continues.
List of all format specifiers : https://codeforwin.org/2015/05/list-of-all-format-specifiers-in-c-programming.html
+ 2
% notation called format specifier in C. Below are few of them :
%c - character - Ex: 'A'
%o - octal number (base 8) - Ex: 04
%s - a string of characters - Ex: 'Pallavi '
%d - integer number - Ex: 256
%x - number in hexadecimal (base 16) - Ex: 0x12
+ 1
Thank you sir!!
+ 1
Thank you!!