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

Explain what is the difference between far and near ?

621


What is the advantage of using #define to declare a constant?

597


How will you find a duplicate number in a array without negating the nos ?

1620


What is function prototype in c with example?

550


What is the use of extern in c?

619






Difference between malloc() and calloc() function?

637


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

625


Why is c so important?

569


Why do we use static in c?

613


Explain how does flowchart help in writing a program?

598


Is there a built-in function in C that can be used for sorting data?

710


Explain how can type-insensitive macros be created?

547


What is nested structure with example?

600


Write a program to print factorial of given number without using recursion?

546


Explain the process of converting a Tree into a Binary Tree.

2067