void main()
{
int i=5;
printf("%d",i++ + ++i);
}
Answer Posted / poseidon
I might agree with ANS #1 because side effects are
involved..The expected answer might not be getting always
although in case of printf(), the arguments are evaluated
from RTL. For example consider the case
int i=10;
printf("%d %d %d %d",i++,--i,i--,--i);
Try some variations of these and and find out whether you
are able to get correctly or not..
In case the result depends on the compiler,for
verification,I will add what my compiler gave me
ANS:7 8 9 8
If anyone find out,pls reply.. Keen to know..
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the difference between the = symbol and == symbol?
What is indirection? How many levels of pointers can you have?
What is signed and unsigned?
int i=10; printf("%d %d %d", i, i=20, i);
What are disadvantages of C language.
What are the differences between Structures and Arrays?
Differentiate fundamental data types and derived data types in C.
how can I convert a string to a number?
Can a program have two main functions?
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
What are pointers? What are stacks and queues?
what is the difference between 123 and 0123 in c?
Describe the order of precedence with regards to operators in C.
What are structures and unions? State differencves between them.
Why is C language being considered a middle level language?