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
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 |
write a program to find the sum of the array elements in c language?
24 Answers ICT, Infosys, Wipro,
Explain built-in function?
Name the language in which the compiler of "c" in written?
what is the purpose of the code, and is there any problem with the code? int f( int n, int l, int r ) { return (n << l) >> r; }
What are identifiers and keywords in c?
What are pragmas and what are they good for?
main() { int i; for(i=0;i<5;i++) printf("%d",1l<<i); } why doesn't 'l' affect the code??????
Describe the modifier in c?
What is c language and why we use it?
What is the right type to use for boolean values in c?
What is use of pointer?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit