Last Updated : 14 Feb, 2019

What will be the output of the following program?

#include <stdio.h>

int main() 
{
    int n = 10,a = (5, 10);

    a += n;
    a -= n;
    a *= n;
    a /= n;

    printf(\"%d\",a);

    return 0;
}

(A) 5
(B) 10
(C) 15
(D) Garbage Value


Answer: (B)

Explanation: a = (5, 10) is equivalent to a = 10
Hence a = 10 after total evalutaion.

Quiz of this Question


Share your thoughts in the comments