C Language - Input/Output Questions and Answers
The C Language Input/Output questions with answers focus on concepts like printf(), scanf(), file handling, and formatted I/O operations in C programming. These programming questions and answers help you understand how data is read from and displayed to the console or files. Practicing such MCQs is crucial for C programming interviews, technical tests, and campus placements conducted by Infosys, TCS, and Wipro. Each question includes detailed solutions and code examples to clarify syntax, input validation, and buffer management—making it ideal for students preparing for technical exams.
C Language - Input/Output
Showing 10 of
54 questions
51. What will be the result of executing the following statement ? int i = 10 printf ( "%d %d %d", i, ++i, i++);
- 10 11 12
- 10 11 11
- result is operating system dependent
- result is compiler dependent
52. What will be the result of the following program if the inputs are 2 3 ? main ( ) { int a, b; printf ("enter two numbers :"); scanf ("%d%d',a,b); printf('%d+%d=%d', a,b, a+b); }
- 2+3=5
- syntax error
- will generate run time error/core dump
- a + b = 5
53. main ( ) { int a=10, b=5, c=3, d=3; if ((a<b) && (c = d++)) printf ("%d %d %d", a,b,c,d); else printf ("%d %d %d %d", a, b, c, d); }
- 10 5 3 4
- 10 5 4 4
- 10 5 3 3
- none of the above
54. What is the output off the following statement ? printf("%u", -1);
- -1
- minimum int value
- maximum int value error
- error