edited by
373 views

2 Answers

Best answer
9 votes
9 votes
Explanation:
the macro call square(5) will substituted by 5*5 so the expression becomes z = 25/5*5 . Since / and * has equal priority the expression will be evaluated as (25/5)*5 i.e. 5*5 = 25
selected by
0 votes
0 votes

The output of the program is 3.

Explanation:

Initially, a is assigned the value 0.

Since there's no case label matching a, the control jumps to default, where a is assigned 4.

Then, it goes to case 6, where a is decremented by 1 (a becomes 3).

Next, it goes to case 5, where a is incremented by 1 (a becomes 4).

Finally, it goes to case 1, where a is decremented by 1 (a becomes 3).

The value of a is printed, which is 3.

Answer:

Related questions

0 votes
0 votes
1 answer
1
Bikram asked May 14, 2017
364 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
209 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 ("%...
1 votes
1 votes
1 answer
3
Bikram asked May 14, 2017
312 views
What is the output of the following program?#include <stdio.h int main() { int a = 0; switch(a) { default: a = 4; case 6: a ; case 5: a = a+1; case 1: a = a-1; } printf("...
7 votes
7 votes
2 answers
4
Bikram asked May 14, 2017
557 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; }