c program to find even and odd number

c program to find even and odd number 

if you are using turbo c compiler please use #include<conio.h> header file. and if you are using devc++ or any other compiler than simply go through the given program below.


#include <stdio.h>
int main()
{
    int number;

    printf("Enter an integer: ");
    scanf("%d", &number);

    // True if the number is perfectly divisible by 2
    if(number % 2 == 0)
        printf("%d is even.", number);
    else
        printf("%d is odd.", number);

    return 0;
}
c program to find even and odd number

Comments

Post a Comment

Popular posts from this blog

c program to convert any three digit number in words

c program to remove characters in string except alphabets