ExamVeda
Login
Home
Operators and Expressions in C Sharp
?

What will be the output of the following C# code?
static void Main(string[] args)
{
    int a = 3, b = 5, c = 1;
    int z = ++b;
    int y = ++c;
    b = Convert.ToInt32((Convert.ToBoolean(z)) && (Convert.ToBoolean(y)) 
     || Convert.ToBoolean(Convert.ToInt32(!(++a == b))));
    a = Convert.ToInt32(Convert.ToBoolean(c) || Convert.ToBoolean(a--));
    Console.WriteLine(++a);
    Console.WriteLine(++b);
    Console.WriteLine(c);
}

Answer & Solution
Correct Answer: Option C
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.