edited by
11,560 views
10 10 votes

Consider the following statements

#define hypotenuse (a, b) sqrt (a*a+b*b);

The macro call hypotenuse(a+2,b+3);

  1. Finds the hypotenuse of a triangle with sides $a+2$ and $b+3$
  2. Finds the square root of $(a+2)^2$ and $(b+3)^2$
  3. Is invalid
  4. Find the square root of $3 *a+4*b+5$

2 Answers

Best answer
18 18 votes

#define hypotenuse (a, b) sqrt (a*a+b*b);

hypotenuse(a+2,b+3)

after macro expansion it will become sqrt(a+2*a+2+b+3*b+3)

Now after evaluating you will get D.

selected by
Answer:
Position:
Show:

Related questions

11 11 votes
5 answers 5 answers
10.1k
10.1k views
go_editor asked Jun 21, 2016
10,081 views
The for loopfor (i=0; i<10; ++i) printf("%d", i&1);prints0101010101011111111100000000001111111111
11 11 votes
4 answers 4 answers
12.3k
12.3k views
go_editor asked Jun 21, 2016
12,325 views
The output of the following program ismain() { static int x[] = {1,2,3,4,5,6,7,8} int i; for (i=2; i<6; ++i) x[x[i]]=x[i]; for (i=0; i<8; ++i) printf("%d", x[i]); }1 2 3 ...
9 9 votes
2 answers 2 answers
10.7k
10.7k views
go_editor asked Jun 21, 2016
10,712 views
Consider the following program fragmenti=6720; j=4; while (i%j)==0 { i=i/j; j=j+1; }On termination j will have the value4896720
9 9 votes
3 answers 3 answers
8.9k
8.9k views
go_editor asked Jun 21, 2016
8,921 views
The following programmain() { inc(); inc(); inc(); } inc() { static int x; printf("%d", ++x); }prints 012prints 123prints 3 consecutive, but unpredictable numbersprints 1...