program to check whether the input intger is odd or even in C language (program 06)
/*Made by Anmol main
Student B.tech Cse
Punjabi university
Hindustan Coding
Program 06*/
#include<stdio.h>
int main()
{ int a; //write the fixed values of a and b if not then take it from the user
printf("Enter a number to check\n");
scanf("%d",&a);
{ if (a==0)
printf("\nThe number is zero\n",a);
else if(a%2==0)
printf("\nThe number %d is even",a);
else if (a%2!=0)
printf("\nThe number is odd",a);
else
printf("\nEnter a valid integer\n",a);
}
return 0;
}
Comments