System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 58
Q1141:
What is the main purpose of a filter function in exception handling?
A. To handle syntax errors
B. To identify and classify exception types
C. To optimize loops
D. To control memory usage
Correct Answer:
B
Chapter: 58
Q1142:
The filter function can treat each _______ differently based on its type.
A. variable
B. exception
C. module
D. file
Correct Answer:
B
Chapter: 58
Q1143:
Which function is used to enable floating-point exceptions in the program?
A. getfp
B. controlfp
C. fpControl
D. enableFloat
Correct Answer:
B
Chapter: 58
Q1144:
What does the variable `fpOld` store in the given program?
A. Exception category
B. Final result
C. Floating-point exception status
D. Filename before crash
Correct Answer:
C
Chapter: 58
Q1145:
Which block uses a switch statement to determine exception generation?
A. finally
B. catch
C. block
D. try
Correct Answer:
B
Chapter: 58
Q1146:
What is the role of the `GetExceptionInformation()` function in the program?
A. Save program output
B. Provide exception details
C. Handle final operations
D. Manage input
Correct Answer:
B
Chapter: 58
Q1147:
What determines the type of exception being thrown in the given program?
A. fpOld
B. fpMask
C. eCategory
D. fpControl
Correct Answer:
C
Chapter: 58
Q1148:
In case of an abnormal termination, where is the floating-point mask restored?
A. catch block
B. except block
C. try block
D. finally block
Correct Answer:
D
Chapter: 58
Q1149:
The filter function is invoked in which clause?
A. try
B. except
C. finally
D. catch
Correct Answer:
B
Chapter: 58
Q1150:
Which variable in the program is used as a reference to the exception type?
A. fpOld
B. fpMask
C. eCategory
D. eType
Correct Answer:
C
Chapter: 58
Q1151:
The `except` clause is used to handle exceptions based on a _______.
A. return code
B. value passed by reference
C. filter function
D. catch block
Correct Answer:
C
Chapter: 58
Q1152:
The user-defined exceptions are generated based on the result of a ______ operation.
A. logical
B. masking
C. multiplication
D. division
Correct Answer:
B
Chapter: 58
Q1153:
eCategory variable receives its value through which type of reference?
A. pointer
B. struct
C. reference object
D. value copy
Correct Answer:
C
Chapter: 58
Q1154:
controlfp function is specifically used for handling what type of exceptions?
A. File
B. Memory
C. Floating-point
D. Logic
Correct Answer:
C
Chapter: 58
Q1155:
The final clause is used to handle _______ termination of the program.
A. normal
B. unexpected
C. graceful
D. manual
Correct Answer:
B
Chapter: 58
Q1156:
controlfp is part of which category of exception handling functions?
A. loop control
B. variable mask
C. IEEE floating-point
D. control flags
Correct Answer:
D
Chapter: 58
Q1157:
User-defined exceptions are identified if the masking operation results in ______.
A. non-zero
B. negative
C. zero
D. infinity
Correct Answer:
C
Chapter: 58
Q1158:
Exception information in the handler is retrieved using ______ function.
A. GetExceptionData()
B. GetExceptionDetails()
C. GetExceptionInformation()
D. GetHandlerData()
Correct Answer:
C
Chapter: 58
Q1159:
The switch statement in the try block is used to _______.
A. handle exceptions
B. call functions
C. evaluate conditions
D. generate specific exceptions
Correct Answer:
D
Chapter: 58
Q1160:
An exception mask is used to ______ floating-point exceptions.
A. disable
B. restore
C. detect
D. generate
Correct Answer:
D