Examveda

What will be the output of the following C# code?
static void Main(string[] args)
{
    int y = 5;
    int x;
    int k = (!(Convert.ToInt32(y) > 10))?  x = y + 3 : x = y + 10;
    Console.WriteLine(x);
    Console.WriteLine(y);
    Console.ReadLine();
}

A. 5, 8

B. 10, 4

C. 8, 5

D. 11, 8

Answer: Option C


Join The Discussion

Related Questions on Operators and Expressions in C Sharp