why do we put %d
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);
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 .