Next: Review Questions Up: The switch statement Previous: Summary

Multiple Choice Questions

switch statements


Try to answer as many of the following Multi-choice questions as you can.

Do not panic if you make any errors. You can always start again by clicking on the "Restart" button, located at the bottom.


Your Details


Please enter your full name :


The Questions


Q1.

What is the value of the variable c after the switch statement below?

x = 3;
switch ( x ) {
  case 1: c = 'A'; break;
  case 2: c = 'B'; break;
  case 3: c = 'C'; break;
  default: c = 'F'; break;
}
 
A
B
C
F


Once you have completed all the questions, and are quite happy with your answers. Then click on the "Submit Answers" button.

Clicking the "Restart" button will clear all your answers, ready to re-enter them.


Please send any comments about this page 



Next: Review Questions Up: The switch statement Previous: Summary