AIM:-Write To Chake Enter Number is Even,Odd,Zero Program Using Programming c.

 

Input:-

 

#include<stdio.h>

int main()

{

    int n;

    

    printf(“Enter an integer = “);

    scanf(“%d”,&n);

    if(n == 0)

        printf(“\nNumber is Zero”);

    else if ( n%2 == 0 )

        printf(“\nNumber is Even”);

    else

        printf(“\nNumber is Odd”);

    return 0;

    

}

Output:-

Enter an integer = 10

Number is Even

Advertisements