#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


Please Help Members By Posting Answers For Below Questions

Differentiate between declaring a variable and defining a variable?

612


What is the total generic pointer type?

731


How can I write functions that take a variable number of arguments?

631


What are conditional operators in C?

630


What is use of #include in c?

603






What is the difference between far and near in c?

604


What is d'n in c?

639


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

650


Can a pointer be volatile in c?

539


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.

14971


application attempts to perform an operation?

1497


What is a pointer in c plus plus?

698


Mention four important string handling functions in c languages .

634


will u please send me the placement papers to my mail???????????????????

1367


What does a pointer variable always consist of?

667