Write a c program to check whether a number is positive or negative
Answers
Answered by
5
Answer:
C program to check whether a number is positive or negative
Explanation:
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;
}
Similar questions
English,
6 months ago
Hindi,
11 months ago
Math,
11 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago