Home Top Ad

Write a program to check whether a number is positive or negative.

Share:


Problem Name:      Write a program to check whether a number is positive or negative.

Source Code:

#include<stdio.h>
main()
{
int a;
printf("Enter a number");
scanf("%d",&a);
if(a>=0)
printf("%d is positive",a);
else
printf("%d is nagative",a);
}

Output:


No comments