aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Programming (C/C++)
  • What will be the output of the following function? main()...
Multiple choice

What will be the output of the following function?

main() { int i=0; for(i=0;i<20;i++) { switch(i){ case 0:i+=5; case 1:i+=2; case 5:i+=5; default i+=4; break;} printf(%d,,i); } }

  1. 0,5,9,13,17

  2. 5,9,13,17

  3. 16,21

  4. Syntax error

Reveal answer Fill a bubble to check yourself
C Correct answer

Keep practicing — related questions

  • What would be the output of the following? main() { int i=4; switch(i) { default: printf(“A”); case 1: prin...
  • What would be the output of the following statement in 'C'? int i=0; for(i=0;i<5;) { switch(i) { case 0: pr...
  • What is the output of the given code? int main() { int i = 128<<4<<3<<2>>6; switch(i) { default : printf(By...
  • What is the output of the given code? int main() { int i = 128<<2<<1<<0; switch(i) { default : printf(Bye);...
  • What is the output of the given C program? int main(){int i = 1048576>>8>>3>>8>>3; switch(i++ - 1) // Line ...
  • What is the output of the given C code? int main(){int i;switch(i) // Line 1{default : printf("No Value\\n"...
  • What is the output of the given C program? int main(){int i = 1048576>>8>>3>>8>>3;switch(i++ - 1) // Line 1...
  • What is the output of the given C program? int main(){int i = 1024<<8<<3>>8>>3;switch(i){default : break;ca...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy