C Programming - Input / Output - Discussion

Discussion Forum : Input / Output - Point Out Errors (Q.No. 2)
2.
Point out the error in the program?
#include<stdio.h>

int main()
{
    char ch;
    int i;
    scanf("%c", &i);
    scanf("%d", &ch);
    printf("%c %d", ch, i);
    return 0;
}
Error: suspicious char to in conversion in scanf()
Error: we may not get input for second scanf() statement
No error
None of above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
23 comments Page 3 of 3.

Pratham said:   1 decade ago
You will not get a chance to supply a character for 2nd scanf().

Pooja said:   5 years ago
I couldn't get the answer can you explain properly?
(1)

Rutuja Revadekar said:   4 years ago
I thought the error was in printf statement.


Post your comments here:

Your comments will be displayed after verification.