Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Multiple Choice Questions

Q1231: Which of the following is not a console control event?
  • A: CTRL_C_EVENT
  • B: CTRL_CLOSE_EVENT
  • C: CTRL_LOGON_EVENT
  • D: CTRL_SHUTDOWN_EVENT
View Answer
C

Q1232: The console control handler is invoked when _______ occurs.
  • A: a syntax error
  • B: a logical exception
  • C: a console event
  • D: a variable overflow
View Answer
C

Q1233: If SetConsoleCtrlHandler fails, what action does the program take?
  • A: Calls main again
  • B: Prints error message
  • C: Terminates automatically
  • D: Restarts the loop
View Answer
B

Q1234: The Ctrl-C event corresponds to which control signal?
  • A: CTRL_CLOSE_EVENT
  • B: CTRL_BREAK_EVENT
  • C: CTRL_C_EVENT
  • D: CTRL_SHUTDOWN_EVENT
View Answer
C

Q1235: The main loop stops when which variable is set to TRUE?
  • A: handlerFlag
  • B: exitMain
  • C: exitFlag
  • D: loopFlag
View Answer
C

Q1236: What function causes the system to wait between beeps in the loop?
  • A: Wait()
  • B: Sleep()
  • C: Delay()
  • D: Stop()
View Answer
B

Q1237: What action does Beep() perform in the loop?
  • A: Generates error
  • B: Displays text
  • C: Plays a sound
  • D: Closes console
View Answer
C

Q1238: The default case in the Handler function handles ______.
  • A: known exceptions
  • B: compile-time errors
  • C: unrecognized events
  • D: syntax errors
View Answer
C

Q1239: SetConsoleCtrlHandler allows adding multiple handlers if _______.
  • A: the program loops forever
  • B: Add is set to FALSE
  • C: Handler is NULL
  • D: Add is set to TRUE
View Answer
D

Q1240: What is printed when a CTRL_C_EVENT is caught by the handler?
  • A: Ctrl-Break received
  • B: Close event triggered
  • C: Ctrl-C received by handler. Leaving in 5 seconds or less.
  • D: Exiting console.
View Answer
C

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now