#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
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What does do in c?
Explain what is operator promotion?
How important is structure in life?
What is getch c?
Explain what is a 'locale'?
Explain the Difference between the New and Malloc keyword.
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
What is structure and union in c?
Explain how do you override a defined macro?
Can one function call another?
Tell me about low level programming languages.
Stimulate calculator using Switch-case-default statement for two numbers