What is the output of the following program?

#include
#define FIRST_PART 7
#define LAST_PART 5
#define ALL_PARTS FIRST_PART + LAST_PART
int main() {
printf ("The Square root of all parts is %dn , ALL_PARTS * ALL_PARTS) ;
return(0);
}

A. 35
B. 144
C. 49
D. 47

Showing Answers 1 - 13 of 13 Answers

priya

  • Aug 2nd, 2005
 

47

  Was this answer useful?  Yes

mef526

  • Feb 13th, 2006
 

Use C guidelines and use

#define ALL_PARTS (FIRST_PART + LAST_PART)

Then the answer is:

(7 + 5) * (7 + 5) = 144

  Was this answer useful?  Yes

Siddartha

  • Apr 16th, 2006
 

The output would be - 47

ALL_PARTS is relaced in the printf stt.

It would be replace by

FIRST_PART + LAST_PART* FIRST_PART + LAST_PART

with the bodmas rule

* preceeds + thus

7+5*7+5 = 7+35+5 = 47

  Was this answer useful?  Yes

Mohammed Isa

  • Jan 3rd, 2007
 

Answer: B

  Was this answer useful?  Yes

Rahul Kumar

  • Jan 30th, 2012
 

Answer is 47.
Explanation:
7+5*7+5=7+35+5=47

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions