C programming & online Test
Pages
Homepage
C-Online Test
C-Interview Question
C-program
C-Tutorial
Disclaimer
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:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Contact Form
Name
Email
*
Message
*
No comments:
Post a Comment