#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
Explain how can I write functions that take a variable number of arguments?
what is different between auto and local static? why should we use local static?
What is pointer to pointer in c?
What is operator promotion?
i got 75% in all semester am i eligible for your company
What is the difference between memcpy and memmove?
Describe the steps to insert data into a singly linked list.
Where can I get an ansi-compatible lint?
Why c is called procedure oriented language?
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.
What are the 4 types of organizational structures?
What is difference between %d and %i in c?
What is the difference between class and object in c?
What is #line?
What standard functions are available to manipulate strings?