Check if the number is positive, negative, or whole.
#include<stdio.h>
void main()
{
int a;
char ch[10];
printf("enter a number\n");
scanf("%d",&a);
if (a<0)
{
printf("it is negative %d",a);
}
else if (a>0)
{
printf("it is positive %d",a);
}
else
{
printf("it is whole number %d",a);
}
}
Comments
Post a Comment