PROGRAM :-
#include <stdio.h>
void main()
{
int num;
printf("Enter a number :");
scanf("%d", &num);
if (num >= 0)
printf("%d is a positive number \n", num);
else
printf("%d is a negative number \n", num);
}
OUTPUT :-
OUTPUT 1:
Enter a number :10
10 is a positive number
OUTPUT 2:
Enter a number : -10
-10 is a negative number
Comments
Post a Comment