main()
{
int i = 10;
printf(" %d %d %d \n", ++i, i++, ++i);
}
Answer Posted / dr. sanyasi naidu pasala
13 11 11
First the value of i was assigned to right most variable ++i. In this first i value which is 10 will be incremented to 11, then assigned to i and printed as 11. Then that 11 is passed to the middle variable which is i++. In this first the value 11 is assigned to i, print the value of i as 11 and then incremented to 12. This 12 is now passed to left most variable ++i. In this the value 12 is first incremented to 13 then assigned to i and print as 13. Even though generally the evaluation will be taken place from right most variable to left most variable, the evaluation process may vary from operating system to operating system.
| Is This Answer Correct ? | 27 Yes | 11 No |
Post New Answer View All Answers
What is the c value paradox and how is it explained?
Differentiate between the = symbol and == symbol?
Explain what is #line used for?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Can you please explain the difference between syntax vs logical error?
Why do we use namespace feature?
What is difference between && and & in c?
Explain what are linked list?
Why is c so popular?
Why header files are used?
What is the size of structure in c?
Explain the meaning of keyword 'extern' in a function declaration.
Explain what is gets() function?
Difference between linking and loading?
What is %s and %d in c?