You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
programming-examples/c/Basic/C Program to Check if a giv...

16 lines
343 B
C

/*
* C program to check whether a given integer is positive
* or negative
*/
#include <stdio.h>
void main()
{
int number;
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);
}