I am trying to use the conditional operator in C to check if a number is even or odd, but I keep getting an error when I compile my code. Here is what I have written:
if (num % 2 == 0 ? printf("Even") : printf("Odd"))
Can someone please help me understand what I am doing wrong and how to fix it? I would really appreciate any guidance on this.