Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 54
Q1101:
An exception can occur ________.
A. only in input/output operations
B. nearly anywhere
C. only in arithmetic operations
D. only during compilation
Correct Answer: B
Chapter: 54
Q1102:
If a file read/write operation fails, programmers include an explicit test for ________.
A. error
B. exception
C. overflow
D. underflow
Correct Answer: A
Chapter: 54
Q1103:
Try-catch blocks are mainly used to handle ________.
A. errors
B. exceptions
C. logical errors
D. syntax errors
Correct Answer: B
Chapter: 54
Q1104:
Errors are usually ________ by the runtime environment.
A. raised
B. ignored
C. fixed
D. logged
Correct Answer: A
Chapter: 54
Q1105:
Exceptions are typically caused by ________.
A. program logic
B. hardware faults
C. network failures
D. operating system
Correct Answer: C
Chapter: 54
Q1106:
Programmers cannot usually recover from ________.
A. errors
B. exceptions
C. warnings
D. logs
Correct Answer: A
Chapter: 54
Q1107:
Errors are usually ________ by the environment in which the application runs.
A. detected
B. raised
C. reported
D. ignored
Correct Answer: B
Chapter: 54
Q1108:
Exceptions differ from errors in that they are caused by ________.
A. code outside the application
B. code within the application
C. code in the operating system
D. code in the compiler
Correct Answer: B
Chapter: 55
Q1109:
A fatal error typically ________ the entire process.
A. pauses
B. terminates
C. continues
D. ignores
Correct Answer: B
Chapter: 55
Q1110:
ReportError function is used by the programmer to ________.
A. handle exceptions
B. report errors
C. prevent errors
D. debug code
Correct Answer: B
Chapter: 55
Q1111:
One limitation of using ReportError is that it ________.
A. only terminates the current thread
B. terminates the entire process
C. restarts the program
D. allows silent error handling
Correct Answer: B
Chapter: 55
Q1112:
Continuing program execution after an error ________.
A. may be required by the programmer
B. is never possible
C. is always dangerous
D. is automatically handled
Correct Answer: A
Chapter: 55
Q1113:
Synchronization resources like events or semaphores ________ when ReportError causes process termination.
A. are released
B. remain held
C. are ignored
D. are reset
Correct Answer: B
Chapter: 55
Q1114:
Programmers might prefer to continue program execution instead of ________ when an error occurs.
A. terminating the process
B. restarting the system
C. logging the error
D. debugging the code
Correct Answer: A
Chapter: 55
Q1115:
The ReportError function ________ the error and lets Windows decide what to do.
A. logs
B. reports
C. ignores
D. corrects
Correct Answer: B
Chapter: 56
Q1116:
A termination handler executes when a thread leaves a block due to ________.
A. normal flow only
B. an exception only
C. both normal flow and exception
D. compiler optimization
Correct Answer: C
Chapter: 56
Q1117:
Termination handlers provide similar functionality as ________.
A. exception handlers
B. error handlers
C. logging handlers
D. debuggers
Correct Answer: A
Chapter: 56
Q1118:
The two main elements of a termination handler are a guarded body of code and a ________.
A. termination block
B. catch block
C. finally block
D. throw block
Correct Answer: B
Chapter: 56
Q1119:
In Microsoft C/C++ Optimizing Compiler, termination handlers are implemented using ________.
A. try and catch
B. try and finally
C. finally and catch
D. try and throw
Correct Answer: B
Chapter: 56
Q1120:
The guarded body of code in a termination handler can be a block, nested blocks, or an entire ________.
A. procedure or function
B. class or object
C. variable or constant
D. loop or conditional
Correct Answer: A

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now