write a program to check even or odd using c language.
#include<stdio.h>
int main()
{
int number;
printf("Enter any integer: ");
scanf("%d",&number);
if(number % 2 ==0)
printf("%d is even number.",number);
else
printf("%d is odd number.",number);
return 0;
}
Sample output:
Enter any integer: 5
5 is odd number.
#include<stdio.h>
int main()
{
int number;
printf("Enter any integer: ");
scanf("%d",&number);
if(number % 2 ==0)
printf("%d is even number.",number);
else
printf("%d is odd number.",number);
return 0;
}
Sample output:
Enter any integer: 5
5 is odd number.
No comments:
Post a Comment