Number is even or odd by using C language


#include<stdio.h>
int main()
{
 int n;
 printf("enter a value :\n");
 scanf("%d",&n);
 if(n%2==0)
 {
  printf("Even");
 }
 else
 {
  printf("odd");
 }
}


OUTPUT :

If the number is even :
If the number is odd :

No comments:

Post a Comment