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

Answers were Sorted based on User's Feedback



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

Answer / ashok kumar

45545

Is This Answer Correct ?    5 Yes 0 No

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

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

More C Interview Questions

What does static mean in c?

1 Answers  


Why we write conio h in c?

0 Answers  


How do you list a file’s date and time?

0 Answers  


Explain can the sizeof operator be used to tell the size of an array passed to a function?

0 Answers  


State two uses of pointers in C?

0 Answers   Aspire, Infogain,






what will be the output of this program main() { int i=1; while (i<=10); { i++; } }

11 Answers  


What is volatile variable in c with example?

0 Answers  


What is 1d array in c?

0 Answers  


1.find the second maximum in an array? 2.how do you create hash table in c? 3.what is hash collision

9 Answers   HCL, Qualcomm,


What is the hardest programming language?

0 Answers  


program to locate string with in a string with using strstr function

2 Answers   Huawei, Shreyas,


What is hungarian notation? Is it worthwhile?

0 Answers  


Categories