2

How does It shows 5 as Out put .

   #include<stdio.h>
    #define max(a,b)(a>b?a:b)
    int main()
    {
     int i=2,j=3,k;
     k=max(++i,++j);
     printf("%d",k);
    }

1 Answers1

0
 define max(a,b)(a>b?a:b)

here in max function we are not sending (2,3), we are sending ++i(2), and ++j(3). That's why when it is comparing like ++a>++b?++a:++b. As ternary operator is getting ++3 and then increment it 1 thus it's become 4.

I hope you get it.

Mujahidul Islam
  • 265
  • 4
  • 8