System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 48
Q1001:
SEH is supported in Windows and ________.
A. Microsoft C++
B. Java
C. Python
D. Linux
Correct Answer:
A
Chapter: 48
Q1002:
Using SEH is essential for handling exceptions in ________ programs.
A. Some specific
B. Most new
C. All
D. No
Correct Answer:
A
Chapter: 48
Q1003:
SEH is primarily designed to handle exceptions at the ________ level.
A. Low-level
B. Application
C. High-level
D. User interface
Correct Answer:
A
Chapter: 48
Q1004:
Microsoft SEH and ISO C++ exception handling are both ways to manage ________.
A. Code exceptions
B. Runtime performance
C. Memory allocation
D. File handling
Correct Answer:
A
Chapter: 48
Q1005:
SEH provides a way to handle exceptions that occur due to ________.
A. Hardware faults
B. Logic errors
C. User input
D. Network issues
Correct Answer:
A
Chapter: 48
Q1006:
Structured exception handling in Microsoft C is a(n) ________.
A. Extension
B. Standard
C. Library
D. Function
Correct Answer:
A
Chapter: 48
Q1007:
It is recommended to use SEH when maintaining ________ code.
A. Existing
B. New
C. Obsolete
D. Faulty
Correct Answer:
A
Chapter: 49
Q1008:
In Python, the block used to test a block of code for errors is called ________.
A. try
B. except
C. else
D. finally
Correct Answer:
A
Chapter: 49
Q1009:
The block that handles an error in Python exception handling is called ________.
A. try
B. except
C. else
D. finally
Correct Answer:
B
Chapter: 49
Q1010:
Which Python block executes code only when there is no error in the try block?
A. try
B. except
C. else
D. finally
Correct Answer:
C
Chapter: 49
Q1011:
The block that executes code regardless of the outcome of try and except blocks is called ________.
A. try
B. except
C. else
D. finally
Correct Answer:
D
Chapter: 49
Q1012:
In Python exception handling, which block is optional and used to clean up resources?
A. try
B. except
C. else
D. finally
Correct Answer:
D
Chapter: 49
Q1013:
The purpose of the try block is to ________.
A. handle errors
B. test code
C. clean resources
D. catch exceptions
Correct Answer:
B
Chapter: 49
Q1014:
The except block is executed when ________.
A. an error occurs
B. information is logged
C. no error occurs
D. processing finishes
Correct Answer:
A
Chapter: 49
Q1015:
The else block runs when ________.
A. no exception occurs
B. an exception occurs
C. after finally block
D. before try block
Correct Answer:
A
Chapter: 49
Q1016:
Finally block is always executed ________.
A. after try and except blocks
B. only on error
C. only on success
D. before except block
Correct Answer:
A
Chapter: 49
Q1017:
The finally block is useful for ________.
A. cleaning up resources
B. running alternative code
C. skipping errors
D. handling specific exceptions
Correct Answer:
A
Chapter: 49
Q1018:
What happens if no exception occurs in the try block and there is an else block?
A. else block runs
B. except block runs
C. finally block skipped
D. finally block runs
Correct Answer:
C
Chapter: 49
Q1019:
In Python, which block is guaranteed to execute even if an exception is raised and not handled?
A. try
B. except
C. else
D. finally
Correct Answer:
D
Chapter: 49
Q1020:
If an exception occurs and is handled, which blocks are executed?
A. try, except, finally
B. try, else, finally
C. try, except, else
D. except, else, finally
Correct Answer:
A