adplus-dvertising
frame-decoration

Question

What is the output of this program?
int main()
{
 
    int a = 1, b = 0;
    int c = a%2 ? a++ : a-- ? a=0 : ++b ? b = 2 : b++ ;
    printf("%d", c);
    return 0;
}

a.

1

b.

2

c.

3

d.

0

Posted under C Programming

Answer: (a).1

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?