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
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
write a programming in c to find the sum of all elements in an array through function.
c language interview questions & answer
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
Difference between linking and loading?
What do you mean by invalid pointer arithmetic?
How can type-insensitive macros be created?
What is function in c with example?
Why we not create function inside function.
What is a shell structure examples?
What are the 3 types of structures?
how can I convert a string to a number?
How can you avoid including a header more than once?
Tell us something about keyword 'auto'.
what are non standard function in c