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 are # preprocessor operator in c?
Describe the steps to insert data into a singly linked list.
Is it better to use a macro or a function?
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
Explain what are header files and explain what are its uses in c programming?
what are enumerations in C
Why is c faster?
What are header files and explain what are its uses in c programming?
Write a program to reverse a given number in c language?
What is main return c?
What is the deal on sprintf_s return value?
What are dangling pointers? How are dangling pointers different from memory leaks?
What is the right type to use for boolean values in c? Is there a standard type?
What is #include called?
Write a program for finding factorial of a number.