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 are shell structures used for?

1029


Why isn't any of this standardized in c? Any real program has to do some of these things.

1190


What does printf does?

1222


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

1952


How will you declare an array of three function pointers where each function receives two ints and returns a float?

1342


How can I implement sets or arrays of bits?

1026


A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(

2235


What is const and volatile in c?

1032


i have a written test for microland please give me test pattern

2716


What is a void pointer in c?

1090


p*=(++q)++*--p when p=q=1 while(q<=6)

1738


Explain how can I make sure that my program is the only one accessing a file?

1211


What are the salient features of c languages?

1084


a program that can input number of records and can view it again the record

1899


formula to convert 2500mmh2o into m3/hr

975