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 the purpose of 'register' keyword?

684


What is actual argument?

587


Is it fine to write void main () or main () in c?

543


Explain how are 16- and 32-bit numbers stored?

781


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

589






What is the difference between new and malloc functions?

574


Where is volatile variable stored?

643


What are the data types present in c?

623


What is main function in c?

547


What is calloc() function?

623


What is an lvalue?

632


What is %d used for?

580


Which is better pointer or array?

597


What is file in c preprocessor?

648


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

645