In which line of the following, an error would be reported? 1. #define CIRCUM(R) (3.14*R*R); 2. main() 3. { 4. float r=1.0,c; 5. c= CIRCUM(r); 6. printf("n%f",c); 7. if(CIRCUM(r))==6.28) 8. printf("nGobbledygook"); 9. } a) line 1 b) line 5 c) line 6 d) line 7

This question is related to Sonata Interview

Showing Answers 1 - 2 of 2 Answers

Sagar

  • Jul 8th, 2005
 

Ans: d (line 7) 
Desc: There is a semicolon in the definition of the macro and so the line 7 will be like 
if((3.14*1.0*1.0); == 6.28) which is a wrong syntax

  Was this answer useful?  Yes

Afan

  • Jul 8th, 2005
 

Ans is ofcourse d)line 7 but a part from that semi colon in the macro there is an extra bracket before ==

  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