System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 52
Q1081:
The except block can catch multiple exceptions using a ________.
A. tuple
B. list
C. dictionary
D. set
Correct Answer:
A
Chapter: 52
Q1082:
In Python, you can specify an exception type after except to handle only that ________.
A. error
B. type
C. of operation
D. package
Correct Answer:
A
Chapter: 53
Q1083:
IEEE 754 is a standard for ________.
A. floating-point exceptions
B. integer arithmetic
C. logical operations
D. data storage
Correct Answer:
A
Chapter: 53
Q1084:
How many types of floating-point exceptions are defined by IEEE 754?
A. 3
B. 4
C. 5
D. 6
Correct Answer:
C
Chapter: 53
Q1085:
Which of the following is NOT a floating-point exception defined by IEEE 754?
A. Invalid operation
B. Stack overflow
C. Division by zero
D. Underflow
Correct Answer:
B
Chapter: 53
Q1086:
Floating-point exception that occurs when a number is too large to be represented is called ________.
A. Underflow
B. Overflow
C. Inexact calculation
D. Invalid operation
Correct Answer:
B
Chapter: 53
Q1087:
The floating-point exception for division by zero is called ________.
A. Overflow
B. Division by zero
C. Invalid operation
D. Underflow
Correct Answer:
B
Chapter: 53
Q1088:
Underflow in floating-point exceptions means the number is ________.
A. too small to be represented
B. too large to be represented
C. not a number
D. exact calculation
Correct Answer:
A
Chapter: 53
Q1089:
The exception raised when the result of a floating-point operation is not exact is called ________.
A. Inexact calculation
B. Overflow
C. Invalid operation
D. Division by zero
Correct Answer:
A
Chapter: 53
Q1090:
Invalid operation floating-point exception occurs when ________.
A. an undefined mathematical operation is performed
B. a number is too large
C. a number is too small
D. division by zero
Correct Answer:
A
Chapter: 53
Q1091:
Which IEEE 754 floating-point exception would be triggered by calculating sqrt(-1)?
A. Overflow
B. Underflow
C. Invalid operation
D. Inexact calculation
Correct Answer:
C
Chapter: 53
Q1092:
Inexact calculation exception is raised when the result of an operation is ________.
A. not perfectly representable
B. exactly zero
C. overflowed
D. underflowed
Correct Answer:
A
Chapter: 53
Q1093:
If an operation results in a number smaller than the smallest representable positive number but not zero, it causes ________.
A. Overflow
B. Underflow
C. Invalid operation
D. Inexact calculation
Correct Answer:
B
Chapter: 54
Q1094:
Errors are usually raised by the ________.
A. application code
B. environment
C. compiler
D. user
Correct Answer:
A
Chapter: 54
Q1095:
Exceptions are caused by ________.
A. the environment
B. the code of the app
C. the compiler
D. the operating system
Correct Answer:
B
Chapter: 54
Q1096:
Recovery from an error is ________.
A. not possible
B. always possible
C. sometimes possible
D. depends on the error
Correct Answer:
A
Chapter: 54
Q1097:
The use of try-catch blocks helps to ________.
A. cause errors
B. handle exceptions
C. prevent compilation
D. errors
Correct Answer:
B
Chapter: 54
Q1098:
Errors occur at ________ and are unknown by the compiler.
A. compile-time
B. run-time
C. link-time
D. load-time
Correct Answer:
B
Chapter: 54
Q1099:
Exceptions may or may not be ________ by the compiler.
A. raised
B. caught
C. ignored
D. reported
Correct Answer:
B
Chapter: 54
Q1100:
Programmers include explicit tests to check for ________.
A. exceptions
B. errors
C. warnings
D. syntax mistakes
Correct Answer:
B