- 1
why do we put %d
2 Respuestas
+ 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 .