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

20. main()
{
int i=5;
printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);
}
Answer:??????

Answer Posted / ashish

The only concept here is that the printf starts 'generating'
results from RHS to LHS.
Hence, in the process of generation: i=5; then --i=4; ++i=5;
i--=5(due to the postfix concept, but after finishing this
calculation i=4); now i++=4(after performing i++, the value
of 'i' is 5, but for printing, due to the postfix concept,
i=4, the current value of 'i' will be printed).

The printing happens in order from LHS to RHS. Hence these
values are printed as 4 5 5 4 5.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by operator precedence?

1156


What is hungarian notation? Is it worthwhile?

1231


What is include directive in c?

1167


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

1075


How can you access memory located at a certain address?

1125


What are the functions to open and close the file in c language?

1042


What is self-referential structure in c programming?

1226


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4699


What is the use of sizeof?

1022


What is sizeof array?

1063


what value is returned to operating system after program execution?

2128


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1080


Explain c preprocessor?

1121


Why is main function so important?

1113


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2267