Program to check number is positive or negative

Last Updated on

#include <stdio.h>
#include <conio.h>

void main()
{
int number;
clrscr();

printf(“Enter a number\n”);
scanf (“%d”, &number);

if (number > 0)
printf (“%d, is a positive number\n”, number);
else
printf (“%d, is a negative number\n”, number);

}

Output
Enter a number
-10
-10, is a negative number

 

 

resume

Mohit Arora
Follow me