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 find binary of number?

4341


What is cohesion in c?

925


Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

1447


Write a Program to accept different goods with the number, price and date of purchase and display them

6150


Explain how can you avoid including a header more than once?

1045


What functions are in conio h?

1154


What is volatile variable in c with example?

1000


What is modifier & how many types of modifiers available in c?

986


Difference between macros and inline functions? Can a function be forced as inline?

1207


What is the use of volatile?

1047


Apart from dennis ritchie who the other person who contributed in design of c language.

1323


write a programming in c to find the sum of all elements in an array through function.

2117


Can we assign integer value to char in c?

1160


Explain how can I write functions that take a variable number of arguments?

1032


How can a string be converted to a number?

968