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
What is the purpose of 'register' keyword?
What is actual argument?
Is it fine to write void main () or main () in c?
Explain how are 16- and 32-bit numbers stored?
When a c file is executed there are many files that are automatically opened what are they files?
What is the difference between new and malloc functions?
Where is volatile variable stored?
What are the data types present in c?
What is main function in c?
What is calloc() function?
What is an lvalue?
What is %d used for?
Which is better pointer or array?
What is file in c preprocessor?
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