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


Please Help Members By Posting Answers For Below Questions

what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

1928


formula to convert 2500mmh2o into m3/hr

498


How does pointer work in c?

621


How do you view the path?

670


Explain a pre-processor and its advantages.

633






What are local static variables? How can you use them?

647


Why do we use main function?

637


What is difference between constant pointer and constant variable?

630


What is a pointer and how it is initialized?

609


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

758


Hi can anyone tell what is a start up code?

1616


What are the two forms of #include directive?

644


What is use of bit field?

774


What do you mean by dynamic memory allocation in c? What functions are used?

656


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

610