edited by
292 views

1 Answer

Best answer
1 votes
1 votes

when the value of a matches with none of the cases, then the default value of 4 gets assigned to a and a "fallthrough" happens since there is no "break" statement. Hence, all the expressions involving a gets executed and the resulting value is 3

selected by
Answer:

Related questions

0 votes
0 votes
1 answer
1
Bikram asked May 14, 2017
353 views
Spot the error(s) in this code snippet :int n=2; // Line 1 switch(n) { case 1.5: printf( "gate"); break; case 2: printf( "overflow"); break; case 'A': printf("gateoverflo...
0 votes
0 votes
0 answers
2
Bikram asked May 14, 2017
196 views
#include <stdio.h int counter(int i) { static int count = 0; count = count + i; return count; } int main() { int i, j; for (i = 0; i <= 5; i++) j = counter(i); printf ("%...
7 votes
7 votes
2 answers
3
Bikram asked May 14, 2017
538 views
What is the output of the following code snippet? #include <stdio.h int main() { char c=125; c=c+10; printf("%d",c); return 0; }
2 votes
2 votes
1 answer
4
Bikram asked May 14, 2017
190 views
The output of this code snippet is :#include <stdio.h #define x 4+1 int main() { int i; i = x*x*x; printf("%d",i); return 0; }