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 a = 5;
int b = 10;
int c;
Console.WriteLine(c = a– – ++b);
Console.WriteLine(b);
Console.ReadLine();
}

What will be the output of the following C# code?
static void Main(string[] args)
{
int a = 5;
int b = 10;
int c;
Console.WriteLine(c = a– – ++b);
Console.WriteLine(b);
Console.ReadLine();
}
a) -7, 10
b) -5, 11
c) -6, 11
d) 15, 11

Answer: c
Explanation: -6, 11

Join The Discussion