aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Expressions and Switch Statements
  • What is the output of the given C code? int main(){int i;...
Multiple choice

What is the output of the given C code?

int main()
{
int i;
switch(i) // Line 1
{
default : printf("No Value\\n");
case 0 : printf("i is 0\\n");
case 1 : printf("i is 1");
}
return 0;
}

  1. No value. i is 0i is 1

  2. i is 0i is 1

  3. i is 1

  4. No output

  5. Compilation error

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This is the correct answer. 

Keep practicing — related questions

  • What is the output of the given C program? int main(){int i = (1048576>>8>>3>>8>>3) + + - + (1024<<8<<3>>8>...
  • What is the output of the given C program? int main() {int i = 1048576>>8>>3>>8>>3;switch(1 + i++ - 1) // L...
  • 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 = 1048576>>8>>3>>8>>3; switch(i++ - 1) // Line ...
  • What is the output of the given C program? int main(){int i = 1024<<8<<3>>8>>3;switch(i) {default : printf(...
  • What is the output of the given C program? int main(){int i = 1024<<8<<3>>8>>3; switch(i) {default : printf...
  • What is the output of the given C program? int main(){int i = 1024<<8<<3>>8>>3;switch(i){default : break;ca...
  • What is the output of the given C code? int main(){bool i=1;switch(round(hypot(114,123))) // Line 1{default...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy