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

praagnovation

2298


how to capitalise first letter of each word in a given string?

1936


Combinations of fibanocci prime series

1621


What are the 5 elements of structure?

1084


Explain what are compound statements?

1068


Is c is a procedural language?

1105


How can I write a function analogous to scanf?

1194


Linked lists -- can you tell me how to check whether a linked list is circular?

1097


In C programming, how do you insert quote characters (‘ and “) into the output screen?

1539


Explain high-order and low-order bytes.

1113


Write a program to swap two numbers without using the third variable?

1078


How main function is called in c?

1134


How do you list a file’s date and time?

1076


What is a nested formula?

1169


How do you determine whether to use a stream function or a low-level function?

1132