Write a C program to find whether a number is positive or negative
Program:-
#include<stdio.h>
int main()
{
int num;
scanf(“%d”,&num);
if(num > 0)
printf(“Positive”);
else
printf(“Negative”);
return 0;
}
int main()
{
int num;
scanf(“%d”,&num);
if(num > 0)
printf(“Positive”);
else
printf(“Negative”);
return 0;
}
Output:-
....
0 comments:
Post a Comment