C | Loops & Control Structure | Question 18
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; } |
chevron_right
filter_none
(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
Recommended Posts:
- C | Loops & Control Structure | Question 2
- C | Loops & Control Structure | Question 8
- C | Loops & Control Structure | Question 1
- C | Loops & Control Structure | Question 12
- C | Loops & Control Structure | Question 19
- C | Loops & Control Structure | Question 13
- C | Loops & Control Structure | Question 10
- C | Loops & Control Structure | Question 14
- C | Loops & Control Structure | Question 11
- C | Loops & Control Structure | Question 15
- C | Loops & Control Structure | Question 16
- C | Loops & Control Structure | Question 17
- C | Loops & Control Structure | Question 21
- C | Loops & Control Structure | Question 9
- C | Loops & Control Structure | Question 20



