#define MAX(x,y) (x) > (y) ? (x) : (y)
main()
{
int i = 10, j = 5, k = 0;
k = MAX(i++, ++j);
printf("%d %d %d", i,j,k);
}
what will the values of i , j and k?
}
Answers were Sorted based on User's Feedback
Answer / jason
The answer is undefined. It is undefined in C to use the
increment operator more than once in the same expression.
MAX(i++, ++j) expands to:
(i++) > (++j) ? (i++) : (++j)
Which guarantees that either i++ or ++j appears twice in the
expression.
http://blog.emptycrate.com/node/329
| Is This Answer Correct ? | 7 Yes | 8 No |
What is a null pointer in c?
why division operator not work in case of float constant?
What is the value of c?
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
Explain heap and queue.
Explain what does it mean when a pointer is used in an if statement?
Explain void pointer?
Explain how can I convert a string to a number?
In which category does main function belong??
What will be your course of action for a push operation?
What should malloc(0) do?
write a program to generate 1st n fibonacci prime number