adplus-dvertising
frame-decoration

Question

What is the output of this program?
#include <stdio.h>
int main()
{
    int a = 5;
    if (a == 6); a = 0;
    if (a == 5)
    a++;
    else a += 2;
    printf("%d", a);
    return 0;
}

a.

6

b.

8

c.

5

d.

2

Posted under C Programming

Answer: (d).2

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?