#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



#define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++..

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

#define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++..

Answer / sunil v r

11,6,11

Is This Answer Correct ?    1 Yes 2 No

#define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++..

Answer / manoj

10,6,11

Is This Answer Correct ?    0 Yes 10 No

#define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++..

Answer / guest

x=11

k=11

j=6

Is This Answer Correct ?    4 Yes 20 No

Post New Answer

More C Interview Questions

What is hashing in c?

0 Answers  


how write a addtion of two single dimensional array using of pointer in c language?

3 Answers   DRDO,


What is meant by 'bit masking'?

0 Answers  


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

0 Answers  


Explain what are the different data types in c?

0 Answers  






1,1,5,17,61,217,?,?.

3 Answers   Apple,


discuss the steps needed to get a program from source code to executable in a system?

1 Answers  


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..

0 Answers   IBM, Wipro,


What is modifier & how many types of modifiers available in c?

0 Answers  


What is structure pointer in c?

0 Answers  


size maximum allocated by calloc()

3 Answers   DELL,


Can we change the value of #define in c?

0 Answers  


Categories