source file name: oddeven.C
void main()
{
int n;
clrscr();
printf("Odd or Even program");
printf("\n enter any number");
scanf("%d",&n);
if(n%2==0)
printf("\n Given no: %d is Even number",n );
else
printf("\n Given no: %d is Odd number",n );
getch();
}
Output:
1. Odd or Even program
enter any number
10
Given no: 10 is Even number
2. Odd or Even program
enter any number
-7
Given no: -7 is Odd number
0 Comments
Post a Comment