Que : write a c program to find even or odd number
Ans:
#include <stdio.h>
int main()
{
int a;
printf("Enter a number : ");
scanf("%d",&a);
if ( a%2==0 )
{
printf("the number is even");
}
else
{
printf("the number is odd ");
}
return 0;
}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Input :
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
Comments
Post a Comment