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 meaning of ?
What is the difference between null pointer and wild pointer?
How does selection sort work in c?
write a program to find the given number is prime or not
a value that does not change during program execution a) variabe b) argument c) parameter d) none
How is a macro different from a function?
What is difference between scanf and gets?
how many key words availabel in c a) 28 b) 31 c) 32
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
Write a program to identify if a given binary tree is balanced or not.
Explain a file operation in C with an example.
Explain the use of 'auto' keyword in c programming?
Explain the concept and use of type void.
Explain what are the advantages and disadvantages of a heap?
What is "Hungarian Notation"?