591 views
1 votes
1 votes

1 Answer

Best answer
4 votes
4 votes

no break statement, so for the first time all cases will be executed.

selected by

Related questions

1 votes
1 votes
2 answers
1
Akriti sood asked Jan 12, 2017
1,671 views
#includeint main(){ char check = 'a';switch (check){case 'a' || 1: printf("Gates ");case 'b' || 2: printf("Quiz ");break;default: printf("GatesQuiz");} return 0; }(a) Gat...
1 votes
1 votes
2 answers
3
Hira Thakur asked Sep 14, 2018
1,467 views
int main() { int a =50; switch(a) { default: a=45; case 49: a++; case 50: a ; case 51: a =a+1; } printf("%d",a); }my doubt is the default case is not executed here why??,...
5 votes
5 votes
1 answer
4
Tuhin Dutta asked Nov 14, 2017
1,436 views
#include <stdio.h>int main(){ int check = 20; const int arr[] = {10, 20, 30}; switch (check) { case arr[0]: printf("Tuhin "); case arr : printf...