How to write a Program to input a number and check if it's positive, negative or zero in C programming language ?
Solution:
//Program to input a number and check if it's positive, negative or zero.
#include<stdio.h>
#include<conio.h>
void main()
{
int number;
clrscr();
printf("Enter a number: ");
scanf("%d", &number);
if(number > 0)
printf("The number %d is positive.", number);
else if(number < 0)
printf("The number %d is negative.", number);
else
printf("The numebr %d is zero.", number);
getch();
}