Program to check weather the number entered is positive or negative in C language. ( program 05)
/*Made by Anmol main
Student B.tech Cse
Punjabi university
Hindustan Coding
Program 05
*/
#include<stdio.h>
int main()
{ int a; //write the fixed values of a and b if not then take it from the user
float area;
printf("Enter a number to check\n");
scanf("%d",&a);
{ if(a>0)
printf("\nThe number %d is positive",a);
else if (a=0)
printf("\nThe number is zero",a);
else
printf("\nThe number is negative",a);
}
return 0;
}
Comments