adplus-dvertising
frame-decoration

Question

What is correct about the given program?

#include <stdio.h>
int x;
void main()
{
    if (x);
    else
        printf("Else");
}

a.

if block will be executed

b.

else block will be executed

c.

Depends on value of x since it is undeclared

d.

Compilation Error

Answer: (b).else block will be executed

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is correct about the given program?