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

void main()
{
int a=1;
printf("%d %d %d",a,++a,a++);
}
the output is supposed to be 1 2 2....but it is 3 3 1
this is due to calling conventions of C. if anyone can
explain me how it happens?

Answer Posted / keerthi

while printing the output it starts from right hand
side ..so first 'a++' value is printed then '++a' value and
last it prints 'a' value

Is This Answer Correct ?    12 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to implement a packet in C

2932


What does volatile do?

1038


Is it better to bitshift a value than to multiply by 2?

1143


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2926


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

1161


What is a volatile keyword in c?

1212


How many parameters should a function have?

1250


What is a null pointer in c?

1310


What is a char in c?

1039


What is the return type of sizeof?

1113


what is the format specifier for printing a pointer value?

1073


How many header files are in c?

1065


What are enumerated types?

1266


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

1139


Explain how can a program be made to print the line number where an error occurs?

1282