In C++, “Out-of-range-index” belong to _____ type exception while keyboard…
20212021
In C++, “Out-of-range-index” belong to _____ type exception while keyboard interrupts are called _____ exceptions.
- A.
synchronous; synchronous
- B.
synchronous; asynchronous
- C.
asynchronous; synchronous
- D.
asynchronous; asynchronous
Attempted by 94 students.
Show answer & explanation
Correct answer: B
In C++ exception handling:
“Out-of-range-index” exceptions occur during program execution due to program logic or invalid indexing. These are synchronous exceptions because they occur as a direct result of program instructions.
Keyboard interrupts occur due to external events independent of the program flow. These are asynchronous exceptions.
Therefore, the correct answer is synchronous; asynchronous.