• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

C Quiz - 105 | Question 4

A typical “switch” body looks as follows:
C
<br>
switch (controlling_expression)<br>
{<br>
  case label1:<br>
    /*label1 statements*/<br>
    break;<br>
  case label2:<br>
    /*label1 statements*/<br>
    break;<br>
  default:<br>
    /*Default statements*/<br>
}<br>

Which of the following statement is not correct statement?

(A)

“switch” body may not have any “case” label at all and it would still compile.

(B)

“switch” body may not have the “default” label and it would still compile.

(C)

“switch” body may contain more than one “case” labels where the label value of these “case” is same and it would still compile. If “switch” controlling expression results in this “case” label value, the “case” which is placed first would be executed.

(D)

“switch” body may not have any “break” statement and it would still compile.

(E)

“switch” body can have the “default” label at first i.e. before all the other “case” labels. It would still compile.

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments