-->
Showing posts with label if if else concept. Show all posts
Showing posts with label if if else concept. Show all posts

Write program to know a number is positive or negative or zero.

//program to know a number is positive or negative or zero.
#include<stdio.h>
#include<conio.h>
void main()
{
float n;
printf("enter a number\n");
scanf("%f",&n);
if(n>0)
{
printf("it is +ve");
}
else if(n<0)
{
printf("it is -ve\n");
}
else
{
printf("it is zero");
}
getch();
}