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...

#include <stdio.h>
#define sqr(x) (x*x)
int main()
{
int x=2;
printf("value of x=%d",sqr(x+1));
}

What is the value of x?

Answer Posted / fazlur

Macro will blindly substitutes, it doesn't calculate. So
remember whenever you encounter the macro, you first
substitute the value then calculate later. Ofcourse the
answer would be 5 in this case.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is #ifdef ? What is its application?

1057


What is ambagious result in C? explain with an example.

2553


Is c is a high level language?

1132


What is nested structure with example?

1017


What does p mean in physics?

992


Is main is a keyword in c?

1075


Explain how can I convert a number to a string?

1103


What is the difference between NULL and NUL?

1247


Which control loop is recommended if you have to execute set of statements for fixed number of times?

1300


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

1099


Explain the red-black trees?

1055


What is c token?

1013


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

1016


Is there any possibility to create customized header file with c programming language?

1009


Which header file should you include if you are to develop a function which can accept variable number of arguments?

1324