Multiple choice .net

Which action will raise an exception?

  1. Dividing by zero.

  2. Assigning the string "Hi" to an integer variable.

  3. Accessing an empty CD drive.

  4. Both a and b.

  5. All of the above.

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

An exception is an error that occurs during execution. Dividing by zero, attempting to store incompatible types (like a string in an integer), or hardware errors like accessing an empty drive all trigger runtime exceptions in the .NET environment.