System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 50
Q1041:
In C language, the conditional and comma operators are useful in filter expressions for ________.
A. complex evaluations
B. simple evaluations
C. ignoring exceptions
D. logging errors
Correct Answer:
A
Chapter: 50
Q1042:
The function Eval_Exception is called when ________.
A. the filter is evaluated
B. the except block starts
C. the finally block starts
D. the try block ends
Correct Answer:
A
Chapter: 50
Q1043:
The except block contains code to ________.
A. catch and handle exceptions
B. skip exceptions
C. resume execution
D. log exceptions
Correct Answer:
A
Chapter: 51
Q1044:
OSError is raised when ________.
A. a system operation causes a system related error
B. an arithmetic operation overflows
C. a weak reference is used
D. an internal interpreter error occurs
Correct Answer:
A
Chapter: 51
Q1045:
Which exception is raised when the result of an arithmetic operation is too large?
A. OSError
B. OverflowError
C. ReferenceError
D. RuntimeError
Correct Answer:
B
Chapter: 51
Q1046:
ReferenceError occurs when ________.
A. a weak reference proxy accesses a garbage collected object
B. a system operation causes error
C. the interpreter detects an internal error
D. the program calls sys.exit()
Correct Answer:
A
Chapter: 51
Q1047:
RuntimeError is raised when ________.
A. an error does not fall under any other category
B. a weak reference proxy is used
C. an arithmetic overflow happens
D. an internal interpreter error occurs
Correct Answer:
A
Chapter: 51
Q1048:
SystemError is raised by ________.
A. an internal error detected by the interpreter
B. an arithmetic operation overflow
C. sys.exit() function
D. a weak reference proxy
Correct Answer:
A
Chapter: 51
Q1049:
Which exception is raised by the sys.exit() function?
A. SystemExit
B. SystemError
C. RuntimeError
D. OSError
Correct Answer:
A
Chapter: 51
Q1050:
OverflowError occurs due to ________.
A. arithmetic operation result too large
B. garbage collected reference
C. internal interpreter error
D. system related error
Correct Answer:
A
Chapter: 51
Q1051:
SystemExit exception is used to ________.
A. exit the program
B. handle system errors
C. access garbage collected references
D. handle runtime errors
Correct Answer:
A
Chapter: 51
Q1052:
If a weak reference proxy is used to access a collected referent, ________ exception is raised.
A. ReferenceError
B. SystemError
C. RuntimeError
D. OSError
Correct Answer:
A
Chapter: 51
Q1053:
RuntimeError catches errors that ________.
A. do not fit in other exception categories
B. are related to system operations
C. occur due to large arithmetic results
D. are caused by sys.exit() function
Correct Answer:
A
Chapter: 51
Q1054:
SystemError is related to ________.
A. internal interpreter errors
B. system related errors
C. arithmetic overflow
D. weak reference access
Correct Answer:
A
Chapter: 51
Q1055:
sys.exit() function raises ________ exception.
A. SystemExit
B. RuntimeError
C. OSError
D. ReferenceError
Correct Answer:
A
Chapter: 51
Q1056:
OSError is not raised when ________.
A. an arithmetic overflow occurs
B. a system related error happens
C. an internal error is detected
D. a weak reference is accessed
Correct Answer:
A
Chapter: 51
Q1057:
The OverflowError exception is specifically related to ________.
A. arithmetic calculations
B. object referencing
C. system exit
D. internal interpreter errors
Correct Answer:
A
Chapter: 51
Q1058:
ReferenceError is associated with ________.
A. garbage collected referent weak proxy
B. internal interpreter errors
C. arithmetic overflow
D. system exit
Correct Answer:
A
Chapter: 51
Q1059:
SystemExit exception can be caught to prevent ________.
A. program termination
B. arithmetic overflow
C. system errors
D. weak reference errors
Correct Answer:
A
Chapter: 51
Q1060:
If you want to handle an internal interpreter error, you should catch ________ exception.
A. SystemError
B. ReferenceError
C. RuntimeError
D. OSError
Correct Answer:
A