Even or Odd ? | C


*Take a value from user and print if the value is even or odd.

Solution:

#include <stdio.h>

int main() {
    int a;
    printf("Press any value:\n");
    scanf("%d",&a);
    if(a%2==0){
        printf("Your value is even number.\n");
    }
    else printf("Your value is odd number.\n");
    return 0;
}

Post a Comment

Post a Comment (0)

Previous Post Next Post