Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
C Program to Check Whether a Number is Positive or Negative
SUBMITTED BY:
kaushal1981
DATE:
Feb. 21, 2017, 9:21 p.m.
FORMAT:
Text only
SIZE:
371 Bytes
Raw
Download
Tweet
HITS:
828
Go to comments
Report
#include <stdio.h>
int main()
{
double number;
printf("Enter a number: ");
scanf("%lf", &number);
if (number <= 0.0)
{
if (number == 0.0)
printf("You entered 0.");
else
printf("You entered a negative number.");
}
else
printf("You entered a positive number.");
return 0;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus