What is the output of this C code ?

Function main() {
  integer a = 5, b = 7
  Switch(a) {
    Case 5: print "I am 5"
    Break
    Case b: print "I am not 5"
    Break
    Default: print "I am different"
  }
}

A. I am 5

B. I am not 5

C. I am different

D. Error

E. None of these

Answer : D. Error

Explanation:

  • Break doesn’t have “;” (Semi Colon missing in break command)

Categorized in: