#include<stdio.h>
main()
{ int i=5;
printf("%d",i*i-- - --i*i*i++ + ++i);
}
tell the answer with correct reason .specially reason is
important nt answer
ans by turbo c is -39
Answer Posted / myname
It it not an easy question.
After investigating it a little bit, I would say:
- It is undefined behaviour, since "i" is being modified more than once between two sequence points.
- I bet that the turbo c answer is not -39, but -34 (5*5 - 4*4*4 + 5) = -34 (not important, anyway, since any other compiler can reorder the operations and give you any other result since, as I have previously said, it is undefined behaviour).
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are header files in c?
How can I send mail from within a c program?
what are the advantages of a macro over a function?
Write a program to swap two numbers without using a temporary variable?
What is hash table in c?
simple program of graphics and their output display
I need a sort of an approximate strcmp routine?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
Is c object oriented?
Explain how can you avoid including a header more than once?
What is s or c?
Explain the use of fflush() function?
ATM machine and railway reservation class/object diagram
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
How to write c functions that modify head pointer of a linked list?