#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

WHOT IS CHAR?

4 Answers   TCS,


#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(ā€œ%dā€ ,a[i]); }

8 Answers  


write a recursive program in'c'to find whether a given five digit number is a palindrome or not

2 Answers  


What functions are used in dynamic memory allocation in c?

0 Answers  


Write a programme to find even numbers without using any conditional statement?

3 Answers   ADD Software, Infosys,






How do I determine whether a character is numeric, alphabetic, and so on?

0 Answers  


How pointer is different from array?

0 Answers  


Hi Every one...........I have been selected for the SBI Clerk. But i m one month Pregnanat. So anyone please suggest me, is they take any objection on my joining .

4 Answers   State Bank Of India SBI,


int main() { int i=-1,j=-1;k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d%d%d%d%d",i,j,k,l,m); }

3 Answers   HCL,


List the difference between a 'copy constructor' and a 'assignment operator' in C?

0 Answers   Accenture,


What is main return c?

0 Answers  


How can I read in an object file and jump to locations in it?

0 Answers  


Categories