Wednesday, 19 February 2014

write a program to check entered number is even or odd using function.


# include<stdio.h>
void check(int);
main()
{
int num;
printf("enter the number:");
scanf("%d",&num);
check(num);
return 0;
}
void check(int n)
{
if(n%2==0)
{
printf("%d is even number",n);
}
else
{
printf("%d is odd number\n",n);
}
}

No comments:

Contact Form

Name

Email *

Message *