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
How can I generate floating-point random numbers?
How to declare a variable?
What is typedef?
What do you mean by a sequential access file?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
How do I create a directory? How do I remove a directory (and its contents)?
What is the use of extern in c?
What does c mean?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
Why are algorithms important in c program?
What is function definition in c?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
Find MAXIMUM of three distinct integers using a single C statement
In C language what is a 'dangling pointer'?
Explain the difference between null pointer and void pointer.