C Programming MCQ Questions and Answers

Take Exam

C Programming MCQ questions with answers are a favorite in programming interview questions with answers for software placement exams like TCS, Infosys, and Wipro. The C language forms the base for all modern programming, focusing on data types, control structures, loops, arrays, and pointers. This section provides a curated set of multiple-choice questions designed to test your coding logic and understanding of C fundamentals. Practice these questions regularly to build confidence and accuracy in technical interviews and coding assessments.

C Programming MCQ

Showing 10 of 25 questions

11. If fopen Q fails, it returns

  • -1
  • NULL
  • 1
  • the file pointer
Show Answer Report

12. The function fclose() is

  • used to disconnect a program from file
  • used to close a file logically
  • both options a and b
  • a mandatory function call in file handling
Show Answer Report

13. The action of connecting a program from a file is obtained by the function

  • fclose()
  • delete()
  • fdisconnect()
  • clear()
Show Answer Report

14. The value returned by fcloseQ, if an error occurs is

  • 0
  • 1
  • EOF
  • -1
Show Answer Report

15. The function(s) used for reading a character from a file is (are)

  • getc()
  • fgetc()
  • both options an and b
  • fgetcharo()
Show Answer Report

16. The function(s) used for writing a character to a file is (are)

  • put()
  • fputc()
  • both options a and b
  • fputcharQ
Show Answer Report

17. The function(s) used for reading formatted input data from a file is (are)

  • getchar()
  • fscanf()
  • scanf()
  • gets()
Show Answer Report

18. The function used for random access of a file is

  • fseek()
  • ftel()
  • sarch()
  • rewind()
Show Answer Report

19. What is the value of origin used in fseek(fptr,position, origin);? to represent end of file.

  • 0
  • 1
  • 2
  • EOF
Show Answer Report

20. What is the value of origin used in fssek(fptr, position, origin);? to represent the beginning of the file

  • 0
  • 1
  • 2
  • START
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test