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

Which is the best website to learn c programming?

0 Answers  


How old is c programming language?

0 Answers  


void main() { int x=25,y=32; clrscr(); x=x++ + y++; y=++x + ++y; printf("%d%d",x,y); }

5 Answers  


What is the Difference between Macro and ordinary definition?

3 Answers   Bosch, Cognizant, College School Exams Tests, Motorola,


What is difference between arrays and pointers?

0 Answers  






Which header file is essential for using strcmp function?

0 Answers  


can we declare a function in side the structure?

2 Answers   HCL,


What does printf does?

0 Answers  


Write the program for displaying the ten most frequent words in a file such that your program should be efficient in all complexity measures.

3 Answers   Google,


what is the difference between normal variables and pointer variables..............

15 Answers   HP, Infosys, Satyam, Vivekanand Education Society,


shorting algorithmS

0 Answers   Wipro,


Explain data types & how many data types supported by c?

0 Answers  


Categories