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


Showing Answers 1 - 4 of 4 Answers

vinayaka

  • Jan 14th, 2006
 

The Ans is A(i.e Line 1)

Since this is error decleration in #define CIRCUM(R) (3.14*R*R); The semicolon is a syntax error.

  Was this answer useful?  Yes

sakhan

  • Mar 1st, 2006
 

The correct answer is B(Line 5). #define CIRCUM(R) (3.14*R*R);means wherever the program encounters CIRCUM(R) replace it with (3.14*R*R); including the semicolon. So the line number 5 will have 2 semicolons continuosly.Got it...

  Was this answer useful?  Yes

simon

  • Apr 15th, 2006
 

two ";" is not an error dude. the second ";" is just a empty statement. the error occours when call if(CIRCUM(r))==6.28)

  Was this answer useful?  Yes

raj

  • Jul 30th, 2006
 

Yes

The error is here
if(CIRCUM(r))==6.28)
in the bracket

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