- 1
why do we put %d
2 Answers
+ 14
C uses formatted output. The 'printf' function has a special formatting character (%) â a character following this defines a certain format for a variable:
%c â characters
%d â integers
%f â floats
e.g. printf("%c %d %f", ch, i, x);
+ 2
Furthering to ĂKR ,
you can use scanf for taking input:
scanf("%c %d %f",&ch,&i,&x);
Note that:you have to use a & operator which indicates the address of ch,i and x variable .