C program to check Even or Odd using the conditional operator
1 |
#include <stdio.h>int main(){int n;printf("Input an integer\n");scanf("%d", &n);n%2 == 0 ? printf("Even\n") : printf("Odd\n");return 0;}</stdio.h> |
C program to check Even or Odd using the conditional operator
1 |
#include <stdio.h>int main(){int n;printf("Input an integer\n");scanf("%d", &n);n%2 == 0 ? printf("Even\n") : printf("Odd\n");return 0;}</stdio.h> |