#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 the difference between 123 and 0123 in c?
what is the difference between entry control and exit control statement?
12 Answers Darbari Lal DAV Model School,
How will you find a duplicate number in a array without negating the nos ?
9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include<stdio.h>’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro?
What are identifiers c?
given the piece of code int a[50]; int *pa; pa=a; to access the 6th element of the array which of the following is incorrect? a.*(a+5) b.a[5] c.pa[5] d.*(*pa + 5)
Can we access the array using a pointer in c language?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
A woman had somany gloves and hats 22 red,34 blue, 45 white...there was power cut and she took a glove and how many gloves shud she take so that she gets a pair of glove fr each color??
how to find the given number is prime or not?
What is the difference between local variable and global variable in c?
What is d scanf?