Geography, asked by shariyayashfeen, 7 months ago

write a program to enter any number and check whether it is a positive number or negative number or zero.​

Answers

Answered by Anonymous
0

Explanation:

\LARGE{\bf{\underline{\underline\color{blue}{Required \:Answer:-}}}}

  • Input a number from user in some variable say num . Check if(num < 0) , then number is negative. Check if(num > 0) , then number is positive. Check if(num == 0) , then number is zero.
Answered by subhashnaidu121
2

Answer:

code in C

Explanation:

#include <stdio.h>

int main() {

double num;

printf("Enter a number: ");

scanf("%lf", &num);

if (num <= 0.0) {

if (num == 0.0)

printf("You entered 0.");

else

printf("You entered a negative number.");

} else

printf("You entered a positive number.");

return 0;

}

Similar questions