check even or odd using conditional operator

#include<stdio.h>
int main() {
    int x,res;
    scanf("%d",&x);
    (x%2==0) ? printf("even"):printf("odd");
   
   
return 0; 
}

No comments:

Post a Comment