#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?
}
Answer Posted / 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 |
Post New Answer View All Answers
Differentiate between declaring a variable and defining a variable?
What is the total generic pointer type?
How can I write functions that take a variable number of arguments?
What are conditional operators in C?
What is use of #include in c?
What is the difference between far and near in c?
What is d'n in c?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
Can a pointer be volatile in c?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
application attempts to perform an operation?
What is a pointer in c plus plus?
Mention four important string handling functions in c languages .
will u please send me the placement papers to my mail???????????????????
What does a pointer variable always consist of?