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 , b;
    int c = 10;
    int d = 12;
    int e = 5;
    int f = 6;
    a = c * (d + e) / f + d;
    Console.WriteLine(a);
    b = c * ( d + e / f + d);
    Console.WriteLine(b);
    if (a < b)
    {
        Console.WriteLine(" parentheses changes values");
    }
    else if (a > b)
    {
        Counterintelligence("they have same value");
    }
    Console.ReadLine();
}

Answer & Solution
Correct Answer: Option B
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.