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
Explain what is the difference between far and near ?
What is the advantage of using #define to declare a constant?
How will you find a duplicate number in a array without negating the nos ?
What is function prototype in c with example?
What is the use of extern in c?
Difference between malloc() and calloc() function?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
Why is c so important?
Why do we use static in c?
Explain how does flowchart help in writing a program?
Is there a built-in function in C that can be used for sorting data?
Explain how can type-insensitive macros be created?
What is nested structure with example?
Write a program to print factorial of given number without using recursion?
Explain the process of converting a Tree into a Binary Tree.