Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis- 1
why do we put %d
2 Respostas
+ 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 .