Write a C program to check wether a number is even or odd?

#include<stdio.h>
#include<conio.h>
int main()
{
  int n;
  printf("Enter any number: ");
  scanf("%d",&n);
  if(n%2==0)
    printf("%d is even",n);
  else
    printf("%d is odd",n);
  return 0;
}

Output 1:

Output 2:



Comments

Popular posts from this blog

Larch Soft Pvt. Ltd. - Best Website & Hosting Provider