C | Loops & Control Structure | Question 19
#include <stdio.h> int main() { int i = 3; while (i--) { int i = 100; i--; printf("%d ", i); } return 0; } |
chevron_right
filter_none
(A) Infinite Loop
(B) 99 99 99
(C) 99 98 97
(D) 2 2 2
Answer: (B)
Explanation: Note that the i–- in the statement while(i-–) changes the i of main()
And i== just after declaration statement int i=100; changes local i of while loop.
Quiz of this Question
Recommended Posts:
- C | Loops & Control Structure | Question 18
- 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 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



