Sail E0 Webinar
Question
What is the output of this C code?

   void main()

    {

        int i = 0;

        while (i < 10)

       {

            i++;

            printf("hi\n");

        } while (i < 8)

       i++;

        printf("hello\n");

    }

Options:
A .  Hi is printed 8 times, hello 7 times and then hi 2 times
B .  Hi is printed 10 times, hello 7 times
C .  Hi is printed once, hello 7 times
D .  Hi is printed once, hello 7 times and then hi 2 times
Answer: Option D


none



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :


Latest Videos

Latest Test Papers