#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 is Dynamic memory allocation in C? Name the dynamic allocation functions.
How can you determine the maximum value that a numeric variable can hold?
Explain Function Pointer?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
Write a Program to find whether the given number or string is palindrome.
What is the use of #include in c?
Why is c still so popular?
What are categories used for in c?
What does it mean when a pointer is used in an if statement?
What is modifier & how many types of modifiers available in c?
When should a type cast be used?
What is the general form of #line preprocessor?
Explain about block scope in c?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
Differentiate between the = symbol and == symbol?