Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Multiple Choice Questions

Q241: fopen(argv[1], "rb") opens the file in
  • A: reading mode
  • B: writing mode
  • C: text mode
  • D: binary reading mode
View Answer
D

Q242: The line `FILE *inFile, *outFile;` declares
  • A: variables to store filenames
  • B: file handles to work with
  • C: integer buffers
  • D: error handlers
View Answer
B

Q243: Which data type is used to store the number of bytes read and written?
  • A: int
  • B: size_t
  • C: char
  • D: long
View Answer
B

Q244: The function fread() returns
  • A: the number of records
  • B: read pointer
  • C: count of bytes read
  • D: buffer address
View Answer
C

Q245: The `argc!=3` check ensures that
  • A: program will compile correctly
  • B: two filenames are passed
  • C: program opens one file only
  • D: error handling is skipped
View Answer
B

Q246: Usage of perror() is to
  • A: display memory size
  • B: print arguments
  • C: handle file data
  • D: report file operation errors
View Answer
D

Q247: If both files are successfully opened, the program enters
  • A: a shutdown mode
  • B: file locking mode
  • C: a loop to copy data
  • D: error handler
View Answer
B

Q248: Binary mode in fopen() ensures
  • A: text formatting is preserved
  • B: file is converted to hex
  • C: formatting is ignored
  • D: file is read and written as raw bytes
View Answer
D

Q249: The copied file will be created using
  • A: `fread()` only
  • B: `fopen()` with "wb" mode
  • C: `fprintf()` command
  • D: line editor
View Answer
B

Q250: After the file copy loop, the program closes both files using
  • A: open()
  • B: abort()
  • C: fclose()
  • D: quit()
View Answer
C

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now