#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

How can I call fortran?

797


Explain built-in function?

801


i want to know the procedure of qualcomm for getting a job through offcampus

2177


What are types of structure?

804


Explain how do you declare an array that will hold more than 64kb of data?

1139


Explain what is the difference between far and near ?

837


What is pointer in c?

934


How many types of operator or there in c?

822


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

857


why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

819


explain what is a newline escape sequence?

853


What is the most efficient way to store flag values?

871


What are the types of assignment statements?

809


Can you mix old-style and new-style function syntax?

843


Why is python slower than c?

793