Home / C Programming / Control Structures :: Discussion

Discussion :: Control Structures

  1. What will be the output of given program?

    #include<stdio.h>

    void main()

    {

    int a=1;

    if("%d=hello", a);

    }

  2. A.

     complier error

    B.

     no error no output

    C.

     0

    D.

     1

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    the

    if

    is conditional and it checks for expression whether it is zero or non-zero so it doesn't print any data it is clear and it is clearly seen that there is not a single syntax error therefore no complier error.
    After compling the program will be executed but there is not a single printf statement so it is executed but will not give any output.


Be The First To Comment