C Language - Input/Output Questions and Answers

Take Exam

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

11.  Identify the correct statement. 

  • C library functions provide I/O facilities
  • C has inherent I/O facilities
  • C doesn't have inherent I/O facilities.
  • options a and c
Show Answer Report

12.  Header files in C contain 

  • compiler commands
  • library functions
  • header information of C programs
  • operators for files
Show Answer Report

13.  How are the library functions made available to a program?

  • by using # define statements
  • by linking loader to the program
  • by using # include statements
  • by using function declarations
Show Answer Report

14.  Identify the character-oriented console I/O functions.

  • getchar () and putchar()
  • gets () and puts ()
  • scanf () and printf ()
  • fgets() andfputs()
Show Answer Report

15.  What is the value returned by getchar () when an alphabet key is pressed ?

  • the alphabet entered from the keyboard
  • the ASCII value of the alphabet entered from the keyboard
  • 0
  • 1
Show Answer Report

16.  The function putchar () uses

  • no argument
  • one argument that is an ASCII value of a character
  • two arguments; first one is ASCII value and thesecond one is number of characters
  • one argument, that is a string
Show Answer Report

17.  The function getchar () uses

  • no argument
  • One argument that is a character variable
  • oneargument that is the ASCII value of a character
  • one argument, that is a string
Show Answer Report

18.  Identify the  wrong statement. 

  • putchar (65)
  • putchar ('x')
  • putchar("x")
  • putchar ('\n')
Show Answer Report

19.  The function scanf () returns

  • the actual values read for each argument
  • the number of successfully read input values
  • no value (void)
  • ASCII values of the characters read
Show Answer Report

20.  The function printf () returns 

  • the actual values displayed for each argument
  • no value (void)
  • the number of characters displayed
  • ASCII values of the characters read
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test