• retagged by
868 views

2 Answers

Best answer
12 12 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 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:
Position:
Show:

Related questions

1 1 vote
1 answers 1 answer
670
670 views
Bikram asked May 14, 2017
670 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 7 votes
2 answers 2 answers
990
990 views
Bikram asked May 14, 2017
990 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; }
3 3 votes
1 answers 1 answer
482
482 views
Bikram asked May 14, 2017
482 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; }
2 2 votes
1 answers 1 answer
1.1k
1.1k views
Bikram asked May 14, 2017
1,097 views
#include <stdio.h void fun() { int p; static int x=1; p = ++x; printf("%d %d", p, x); if(p <= 2) fun(); printf(“%d %d”, p, x); } int main() { fun(); fun(); }In the above ...