I wrote the absolute function using ternary operator as follows
int abs(int a) { a >=0 ? return a : return -a; }
I get the following er
Your syntax is incorrect. It should be
if (a >=0) return a; else return -a;
or the way you wanted it:
return a >=0 ? a : -a;