Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

C | Loops & Control Structure | Question 18

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

How many times GeeksQuiz is printed




#include<stdio.h>
int main()
{
    int i = -5;
    while (i <= 5)
    {
        if (i >= 0)
            break;
        else
        {
            i++;
            continue;
        }
        printf("GeeksQuiz");
    }
    return 0;
}

(A) 10 times
(B) 5 times
(C) Infinite times
(D) 0 times


Answer: (D)

Explanation: The loop keeps incrementing i while it is smaller than 0. When i becomes 0, the loop breaks. So GeeksQuiz is not printed at all.

Quiz of this Question

My Personal Notes arrow_drop_up
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads