What will be the output of this code?

const int a = int.MaxValue;
const int b = int.MaxValue;
int r;
checked
{
r = a * b;
Console.WriteLine(r);
}

 Posted by Ddd on 3/13/2011 | Category: C# Interview questions | Views: 6063 | Points: 40
Select from following answers:
  1. OveflowException
  2. No exception
  3. Compiler error
  4. Code executes, but the result is truncated
  5. All Above

Show Correct Answer


| Alert Moderator 

Comments or Responses

Posted by: Random-user on: 6/16/2011 | Points: 10
the correct answer is - 1) Overflow Exception

Login to post response