main()
{
int i = 10;
printf(" %d %d %d \n", ++i, i++, ++i);
}
Answers were Sorted based on User's Feedback
Answer / dhivya
11 11 13
++i which means i is first incremented and then printed thus i value becomes 11,
i++ which means i is printed and then it is incremented, since the value of i is now 11, it is printed and then incremented to 12.
again ++i , increments i to 13 and then prints.
| Is This Answer Correct ? | 66 Yes | 38 No |
Answer / 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 |
Answer / krityangan
The Answer is 13 11 13
because the post increment will printed first and then pre.
i=10
the ++i=11,i++=12,++i=13,but in c the compiler will print ++p which is now 13 and after that when the compiler come to i++ it will print 11 because in the pre addition the previous vale is printed first andthan i= 12.
| Is This Answer Correct ? | 27 Yes | 11 No |
Answer / pooja alagarsamy
when compiled as a program, it gives this output:
13 11 13
| Is This Answer Correct ? | 3 Yes | 0 No |
what is the output of following question? void main() { int i=0,a[3]; a[i]=i++; printf("%d",a[i] }
Fifty minutes ago if it was four times as many mints past 3 o clock. how many minutes is it to six o'clock n how....?????
What is a memory leak? How to avoid it?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?
what is recursion in C
Write a program which calculate sum of several number and input it into an array. Then, the sum of all the number in the array is calculated.
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
Array is an lvalue or not?
Program to trim a given character from a string.
What is floating point exception error? And what are different types of errors occur during compile time and run time? why they occur?
explain what are pointers?