#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?
}
Answers were Sorted based on User's Feedback
Answer / 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 |
What is hashing in c?
how write a addtion of two single dimensional array using of pointer in c language?
What is meant by 'bit masking'?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
Explain what are the different data types in c?
1,1,5,17,61,217,?,?.
discuss the steps needed to get a program from source code to executable in a system?
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
What is modifier & how many types of modifiers available in c?
What is structure pointer in c?
size maximum allocated by calloc()
Can we change the value of #define in c?