#define d 10+10
main()
{
printf("%d",d*d);
}

Answer Posted / vrushali

This boils down to (10 +10 * 10 + 10)

so answer is 120 ... but if the same macro was rewritten as
#define d (10 + 10)

then d * d = (10 + 10 ) * (10 + 10)
= 20 * 20
= 400....

Pure macro concept....

Is This Answer Correct ?    15 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the size of a union variable?

604


Can we declare variable anywhere in c?

539


How do I swap bytes?

634


How can variables be characterized?

1654


Why can't I perform arithmetic on a void* pointer?

639






What are header files why are they important?

586


When should a type cast be used?

577


What is the difference between the expression “++a” and “a++”?

652


what are the 10 different models of writing an addition program in C language?

1443


When the macros gets expanded?

792


What is static volatile in c?

580


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1124


Explain how can I read and write comma-delimited text?

661


What are the different types of linkage exist in c?

615


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

649