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.

  1. A.

    synchronous; synchronous

  2. B.

    synchronous; asynchronous

  3. C.

    asynchronous; synchronous

  4. 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.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs