Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following C# code?
public static void Main(string[] args)
{
double ZERO = 0;
Console.WriteLine(“RESULT OF DIVISION BY ZERO IS :{0}”, (0 / ZERO));
Console.ReadLine();
}

What will be the output of the following C# code?
public static void Main(string[] args)
{
double ZERO = 0;
Console.WriteLine(“RESULT OF DIVISION BY ZERO IS :{0}”, (0 / ZERO));
Console.ReadLine();
}
a) 1
b) exception argument is thrown
c) NaN
d) 0

Answer: c
Explanation: NaN

Join The Discussion