First Method:
#include <stdio.h>
int main()
{
int n;
printf("Enter a number:");
scanf("%d", &n);
if(n%2!=0)
{
printf("Number=%d is odd",n);
}
}
Second Method:
#include <stdio.h>
int main()
{
int n;
printf("Enter a number:");
scanf("%d", &n);
if(n%2==1)
{
printf("Number=%d is odd",n);
}
}
No comments:
Post a Comment