+ 1

I don't understand the meaning of this sentence.

Format specifiers begin with a percent sign % and are replaced by corresponding arguments after the format string.

14th Feb 2020, 1:16 PM
ęž—å¦¤å®ø
ęž—å¦¤å®ø - avatar
4 Answers
+ 3
å“Ŗäø€čŖ²ēš„ļ¼Ÿé€™äø€čŖ²å—Žļ¼Ÿ https://www.sololearn.com/learn/C/2912/ %d ę•“ę•ø %f 小ę•ø %c char 例如ļ¼š printf("%d \n", c); format string ꌇ "%d \n" argument ꌇ variable c printf("%f \n", salary); format string ꌇ "%f \n" argument ꌇ variable salary åœØē¬¬äŗŒčŖ²ļ¼Œē¬¬äŗŒå€‹ code右äø‹ę–¹ļ¼ŒęŒ‰é‚£å€‹ TRY IT YOURSELFļ¼Œé€²å…„ code playground, ē„¶å¾ŒRunļ¼Œēœ‹output怂 - - - Due to Sololearn Q&A forum rules, please use meaningful question name and relevant tags. For this question, the tag should be "c" and "format-specifier". The question shoud be "Format Specifier in C". Please correct your question, thanks.
14th Feb 2020, 1:21 PM
Gordon
Gordon - avatar
+ 3
i.e int num1 = 1; int num2 = 2; printf("%d and %d", num1, num2) ; %d is a format specifier for integers. in the above example first %d will be replaced by num1 second %d will be replaced by num2 output : 1 and 2 if you switch the places of num1 and num2 like : printf("%d and %d", num2, num1) ; output : 2 and 1 there are many format specifiers it's what specifies how a value is treated, as a char or int or float...
14th Feb 2020, 1:26 PM
Bahhaāµ£
Bahhaāµ£ - avatar
0
%d,%s,%f like that are position holder's
15th Feb 2020, 8:33 PM
Prasad Shinde
Prasad Shinde - avatar