#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
Is c is a high level language?
Do you know what are bitwise shift operators in c programming?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
Implement bit Array in C.
What does c mean?
What is data types?
What is malloc calloc and realloc in c?
What are the types of variables in c?
What is file in c preprocessor?
How is = symbol different from == symbol in c programming?
how can I convert a string to a number?
What is exit() function?
program to convert a integer to string in c language'
What is the difference between the expression “++a” and “a++”?
What is the difference between if else and switchstatement