Examveda

What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int x = 5;
    if (true);
        printf("hello");
}

A. It will display hello

B. It will throw an error

C. Nothing will be displayed

D. Compiler dependent

Answer: Option B


This Question Belongs to C Program >> Control Structures

Join The Discussion

Comments (1)

  1. Chang Vijay
    Chang Vijay:
    2 years ago

    the output is hello

Related Questions on Control Structures