adplus-dvertising
frame-decoration

Question

Guess the output of the program ?
#include<stdio.h>
int main()
{
    int a=0, b=1, c=2;
    *((a+1 == 1) ? &b : &a) = a ? b : c;
    printf("%d, %d, %d\n", a, b, c);
    return 0;
}

a.

1,1,2

b.

2,2,2

c.

0, 2, 2

d.

0,1,2

Answer: (c).0, 2, 2

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Guess the output of the program ?