Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / jyothikrishna

Ex:1
#define A 10+10
void main()
{
int a;
a = A*A;
cout<<a<<endl;
}

Ans : 120

Explanation:
When you compile this program. A*A will be converted into 10+10*10+10. Here it follows BODMAS rule first it will perform multiplication and next it will perform addition.

First 10+10*10+10 = 10 + 100 + 10
next 10 + 100 + 10 = 120 (Answer)

Ex:2
#define A (10+10)
void main()
{
int a;
a = A*A;
cout<<a<<endl;
}

Ans : 400

Explanation:
When you compile this program. A*A will be converted into (10+10)*(10+10). Here it follows BODMAS rule first it will perform Bracket values and next it will perform multiplication.

First (10+10)*(10+10) = 20 * 20
next 20 * 20 = 400 (Answer)

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the function toupper() do?

1130


How pointers are declared?

960


Why should I use standard library functions instead of writing my own?

1274


What is preprocessor with example?

1064


shorting algorithmS

2255


Explain how do you determine a file’s attributes?

1050


Explain what’s a signal? Explain what do I use signals for?

1165


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

1070


What is the difference between struct and union in C?

1316


Explain do array subscripts always start with zero?

1238


Explain how can you tell whether a program was compiled using c versus c++?

1103


Why void main is used in c?

1051


What is static memory allocation?

1178


What is a node in c?

975


Why c is called a mid level programming language?

1074