#include<stdio.h> int main() { int a = 5; switch(a) { default: a = 4; case 6: a--; case 5: a = a+1; case 1: a = a-1; } printf("%d \n",a); return 0; }
(a) 5 (b) 4 (c) 3 (d) None of these
the output of the given programm:
They have not mention the break for any of the case so the default case also not execute ,If we put break in case 5 the answer will be "6".
for refrence check thie link: http://codepad.org/nQifZJsR
64.3k questions
77.9k answers
244k comments
80.0k users