I wanted to use this logic to find the largest of three numbers. However, my code does not compile and I don't understand the compiler message. How do I fix the code?
#include <stdio.h>
#define LARGE(a, b, c){ \
int max = 0, a, b, c;\
max = ( (a+b) + abs(a+b)/2 ); \
max = (max + c) + abs(max+c)/2);}
int main(void) {
int a, b, c, max, Result;
scanf("%d%d%d", &a, &b, &c);
Result = LARGE(a, b, c);
printf("%d", Result);
return 0;
}
output is
ain.c:12:12: error: expected expression
Result=LARGE(a,b,c);
^
main.c:2:21: note: expanded from macro 'LARGE'
#define LARGE(a,b,c){ \
^
1 error generated.