#include<stdio.h>
#include<conio.h>
main()
{
int number,remainder;
clrscr();
printf("\n Enter a number:");
scanf("%d",&number);
remainder=number%2;
if(remainder== 0)
printf("\n The given number is even number");
else
printf("\n The given number is odd number");
getch();
}
Explanation:
Take a number is 95
remainder =95%2, we get 1 as remainder
The number 95 is odd number
Output:
Run-1
Run-2
Previous Next
#include<conio.h>
main()
{
int number,remainder;
clrscr();
printf("\n Enter a number:");
scanf("%d",&number);
remainder=number%2;
if(remainder== 0)
printf("\n The given number is even number");
else
printf("\n The given number is odd number");
getch();
}
Explanation:
Take a number is 95
remainder =95%2, we get 1 as remainder
The number 95 is odd number
Output:
Run-1
Run-2
Previous Next
No comments:
Post a Comment