what are Format Specifier in C language

what are Format Specifier in C language

Online computing

55 лет назад

626 Просмотров

Introduction to Format Specifiers in C

In C programming language,  format specifiers are a kind of special operators that are used for input and output processing i.e. these specifiers are a type of data that is used to print the data on standard output. These specifiers are usually associated with printf and scanf functions for printing the output data that is referred to by any variable. So whenever we want to print the value of the variable on the standard output then we use scanf() function through which we use format specifier for particular data types to print accordingly and these are implemented in printf() function. These format specifiers usually start with the “%” symbol followed by characters for particular data types

In the C programming language, there are different varieties of format specifiers for different data types. The format specifier starts with the “%” symbol followed by the characters of specified data types.  We use these format specifiers to print on the output using printf() function and to take the values we use the same format specifier using scanf() function. Let us see the list of format specifiers used in C programming language for different data types.

Syntax:

Printf("%format_specifier", variable_name); Scanf(" %format_specifier", &variable_name);

Some of the basic format specifiers used in C programming language are as follows:

For integer data types we use the “%d” format specifier to print the integer values.

Тэги:

#km_20240120_1080p_30f_20240120_092302
Ссылки и html тэги не поддерживаются


Комментарии: