C Programming MCQ Question and Answer

C Programming MCQ Question and Answer
11. If fopen Q fails, it returns
  • -1
  • NULL
  • 1
  • the file pointer
Show Answer
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
13. The action of connecting a program from a file is obtained by the function
  • fclose()
  • delete()
  • fdisconnect()
  • clear()
Show Answer
14. The value returned by fcloseQ, if an error occurs is
  • 0
  • 1
  • EOF
  • -1
Show Answer
15. The function(s) used for reading a character from a file is (are)
  • getc()
  • fgetc()
  • both options an and b
  • fgetcharo()
Show Answer
16. The function(s) used for writing a character to a file is (are)
  • put()
  • fputc()
  • both options a and b
  • fputcharQ
Show Answer
17. The function(s) used for reading formatted input data from a file is (are)
  • getchar()
  • fscanf()
  • scanf()
  • gets()
Show Answer
18. The function used for random access of a file is
  • fseek()
  • ftel()
  • sarch()
  • rewind()
Show Answer
19. What is the value of origin used in fseek(fptr,position, origin);? to represent end of file.
  • 0
  • 1
  • 2
  • EOF
Show Answer
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
Questions and Answers for Competitive Exams Various Entrance Test