void main()
{
int i=5;
printf("%d",i++ + ++i);
}
Answer Posted / buvaneswari
as already told,the precedence wil be from right to left..
so i++ the value wil be still 5 and incremented value wil be stored in memory..
and next ++i now the value of i=5 not considering the memory value...so ++i =6...now the new value of i is 6.this wil be replaced the value 5 in the memory
u can see the expression as i+i in default or consider to be
i=i++ and i=++i....so i+i(ie)6+6=12....
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
program to convert a integer to string in c language'
Compare interpreters and compilers.
Why clrscr is used after variable declaration?
What is the correct declaration of main?
How can this be legal c?
Is there a way to compare two structure variables?
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
What is the difference between single charater constant and string constant?
How do you construct an increment statement or decrement statement in C?
When should structures be passed by values or by references?
How to write c functions that modify head pointer of a linked list?
What is function definition in c?
How can I write a function analogous to scanf?
Can you pass an entire structure to functions?
How do you list files in a directory?