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)
{
float a = 10.553f;
long b = 12L;
int c;
c = Convert.ToInt32(a + b);
Console.WriteLine(c);
}

What will be the output of the following C# code?
static void Main(string[] args)
{
float a = 10.553f;
long b = 12L;
int c;
c = Convert.ToInt32(a + b);
Console.WriteLine(c);
}
a) 23.453
b) 22
c) 23
d) 22.453

Answer: c
Explanation: The two data type ‘float’ and ‘long’ after arithmetic operation completely converted to nearest whole number 23.

Join The Discussion