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 / hemanth

All,

output of above code is compiler depended i.e the order of
evalulation.

Is This Answer Correct ?    8 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c language in simple words?

1068


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

1053


I heard that you have to include stdio.h before calling printf. Why?

1063


How do you print only part of a string?

1018


a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.

5061


What does %c mean in c?

1082


Explain how can a program be made to print the name of a source file where an error occurs?

1197


When a c file is executed there are many files that are automatically opened what are they files?

1107


What are the disadvantages of a shell structure?

1342


What is c system32 taskhostw exe?

1022


What is the purpose of 'register' keyword in c language?

1022


Explain what does a function declared as pascal do differently?

1278


What is keyword in c?

1009


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

2364


What should malloc() do?

1167