Computer Science · C Programming Control Structures
Which of the following C code snippets will produce a non-empty output printed to the console when executed?
- 1int j = 0; do { if(j % 2 == 0) { j++; continue; } else break; printf('"%d "', j); } while(j < 5);
- 2switch(1) { case 1: for(int i = 0; i < 5; i++) { if(i % 2 == 0) continue; printf('"%d "', i); } break; default: break; }✓
- 3for(int i = 0; i < 5; i++) { if(i % 2 == 0) continue; else break; printf('"%d "', i); }
- 4int i = 0; while(i < 5) { if(i % 2 == 0) { i++; continue; } else break; }
Correct answer
switch(1) { case 1: for(int i = 0; i < 5; i++) { if(i % 2 == 0) continue; printf('"%d "', i); } break; default: break; }
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on C Programming Control Structures?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · C Programming Control Structures