Write a C program to find whether a given number is odd or even

#include<stdio.h>
main()
{
int a,b;

printf("enter a number to check if the number is odd or even");
scanf("%d",&a);
b=(a%2);
if (b=0)
printf("your inputed number %d is even",a);
else
printf("your inputed number %d is odd",a);
return 0;
}

Post a Comment

0 Comments