Examveda
Examveda

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int x = 0;
    if (x == 0)
        printf("true, ");
    else if (x = 10)
        printf("false, ");
    printf("%d\n", x);
}

A. false, 0

B. true, 0

C. true, 10

D. compile time error

Answer: Option B


This Question Belongs to C Program >> Control Structures

Join The Discussion

Related Questions on Control Structures