main()
{ int i=5;
printf("%d",++i + i);
} output is 10
------------------------
main()
{ int i=5;
printf("%d",i++ + i);
}output is 12
why it is so? give appropiate reason....
Answer Posted / ashi smita
in first program i is post increment than i=5 and i=5+5=10
than i is increment by 1 and the value of i is 6 but second
program first i is preincrement by 1 and the value of is 6
than sum of i is 12.
| Is This Answer Correct ? | 3 Yes | 10 No |
Post New Answer View All Answers
Explain the difference between call by value and call by reference in c language?
Is null equal to 0 in sql?
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
What are identifiers c?
How do I get a null pointer in my programs?
What is an example of structure?
Is it valid to address one element beyond the end of an array?
Is struct oop?
What is meant by type specifiers?
Where static variables are stored in c?
What is a struct c#?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
What is wrong with this program statement?
What are the types of arrays in c?
Why is c so powerful?