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 |
what is the code for getting the output as * ** ***
What is the difference between text and binary modes?
read an array and search an element
Can u return two values using return keyword? If yes, how? If no, why?
What are predefined functions in c?
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What is the c value paradox and how is it explained?
Given a single Linked list with lakhs of nodes and length unknown how do you optimally delete the nth element from the list?
int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output?
What functions are used for dynamic memory allocation in c language?
What is the Purpose of 'extern' keyword in a function declaration?
What is the data segment that is followed by c?