0

What is the output of these code? And why?

#include <stdio.h> //Compiler version gcc 6.3.0 #define max(a,b)a>b?a:b; int main(void) { int m,n; m=3+max(2,3); n=2*max(3,2); printf("m is %d ,n %d" ,m, n); return 0; }

11th Mar 2018, 4:27 PM
Rishab Solanki
1 Answer
0
for this program to work as desired you need to enclose a>?a:b in bracket and remove semi-colon after the macros #define max(a,b) ((a>b)?a:b)
11th Mar 2018, 5:15 PM
‎ ‏‏‎Anonymous Guy