‘C’ program to accept a number and check if it is positive, negative or zero.
C File =>
/* Write a ‘C’ program to accept a number and check if it is positive, negative or
zero. */
#include<stdio.h>
int main()
{
int num;
printf("\n Enter an integer : ");
scanf("%d",&num);
if(num==0)
printf("\n Number is Zero");
else if(num>0)
printf("\n Number is positive");
else if(num<0)
printf("\n Number is negative");
return 0;
}
Comments
Post a Comment
Please do not enter any spam link in message.