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 meant by operator precedence?
What is hungarian notation? Is it worthwhile?
What is include directive in c?
I heard that you have to include stdio.h before calling printf. Why?
How can you access memory located at a certain address?
What are the functions to open and close the file in c language?
What is self-referential structure in c programming?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
What is the use of sizeof?
What is sizeof array?
what value is returned to operating system after program execution?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
Explain c preprocessor?
Why is main function so important?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.