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?
static void Main(string[] args)
{
int x = 1;
float y = 2. 4f;
short z = 1;
Console. WriteLine((float) x + y * z – (x + = (short) y) );
Console. ReadLine();
}

What will be the output of the following C# code?
static void Main(string[] args)
{
int x = 1;
float y = 2. 4f;
short z = 1;
Console. WriteLine((float) x + y * z – (x + = (short) y) );
Console. ReadLine();
}
a) 0.4000004
b) 0.4000023
c) 0.0400021
d) 0.4000001

Answer: d
Explanation: 0.4000001

Join The Discussion