C program that determines if a number is either positive, zero, or negative
###### Posted by Samath
Last Updated: November 07, 2014

Write a C program that reads a single integer number from the keyboard via the scanf function, determines if the number is either, positive, zero, or negative and then prints out a message such as: "The number is positive." or "The number is zero." or "The number is negative.

Here is the solution for the above question:

```#include <stdio.h>
int main(int argc, char *argv[])
{
int num;

printf("Please enter a number: ");
scanf("%d",&num);

if(num == 0)
{
printf("The number is zero.\n");
}
else if(num > 0)
{
printf("The number is positive.\n");
}
else if(num < 0)
{
printf("The number is negative.\n");
}
return 0;
}```
###### Java program that reads an integer and prints if it's positive or negative
Samath | Feb 11, 2021
###### Java program that reads a floating ­point number and prints zero if the number is zero. Otherwise, print positive or negative
Samath | Feb 11, 2021
###### C program that determines if a number is equal to zero
Samath | Nov 07, 2014
###### C program that receives an integer number and determines if it is a prime number
Samath | Jun 01, 2015
###### C program that takes a non- negative integer number as input and prints its binary representation
Samath | Jan 01, 2017
###### C program that takes as input a positive fractional number and converts it to binary
Samath | Jan 01, 2017
###### Java program that prints the sum of the first ten positive integers
Samath | Jan 08, 2021
###### Java program that prints the product of the first ten positive integers
Samath | Jan 08, 2021
###### Write a Python function to find the smallest missing positive integer in a list.
OliviaWm | Aug 09, 2024
###### C program that receives a positive float number and divides it by two until the result is less than or equal to zero
Samath | Jun 12, 2015
###### C program that prompts the user for a positive integer and then computes the sum of all the digits of the number
Samath | May 04, 2016
###### Write a Python function to find the first missing positive integer in an unsorted list.
HenryPk | Aug 11, 2024
###### Java program that read a five-digit positive integer and breaks it into a sequence of individual digits
Samath | Feb 10, 2021
###### C program that generates a random positive float number in a fixed interval with a maximum distance between endpoints of 100
Samath | Jan 01, 2017