Home / CSE MCQs / C-MCQs :: Control Flow Statements

CSE MCQs :: C-MCQs

  1. What is the output of this C code?


        int main()

        {

            int i = 0;

            while (i = 0)

                printf("True\n");

            printf("False\n");

        }

  2. A.
    True (infinite time)
    B.
    True (1 time) False
    C.
    False
    D.
    Compiler dependent

  3. What is the output of this C code?


        int main()

        {

            int i = 0, j = 0;

           while (i < 5, j < 10)

            {

                i++;

                j++;

           }

            printf("%d, %d\n", i, j);

        }

  4. A.
    5, 5
    B.
    5, 10
    C.
    10, 10
    D.
    Syntax error

  5. Which loop is most suitable to first perform the operation and then test the condition?
  6. A.
    for loop
    B.
    while loop
    C.
    do-while loop
    D.
    None of the mentioned