#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

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

602


what is different between auto and local static? why should we use local static?

630


What is pointer to pointer in c?

624


What is operator promotion?

615


i got 75% in all semester am i eligible for your company

1724






What is the difference between memcpy and memmove?

587


Describe the steps to insert data into a singly linked list.

612


Where can I get an ansi-compatible lint?

628


Why c is called procedure oriented language?

563


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2206


What are the 4 types of organizational structures?

611


What is difference between %d and %i in c?

678


What is the difference between class and object in c?

567


What is #line?

597


What standard functions are available to manipulate strings?

552