ExamVeda
Login
Home
Operators and Expressions in C Sharp
?

What will be the output of the following C# code?
public static void Main(string[] args)
{
    int a = 4;
    int c = 2;
    bool b = (a % c == 0 ? true : false);
    Console.WriteLine(b.ToString());
    if (a/c == 2)
    {
        Console.WriteLine("true");
    }
    else
    {
        Console.WriteLine("false");
    }
    Console.ReadLine();
}

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.