Positive or Negative
Submit solution
C
Points:
20 (partial)
Time limit:
10.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
TASK
Write a program in C to check whether the given number is positive or negative
Input Format:
A single line containing user input as an integer
Output Format:
A single line containing the user output integer
Sample Input 1: 25
Sample Output1 :
Positive
Sample Input 2: -15
Sample Output 2:
Negative
Comments
include <stdio.h>
int main() { int a; printf("enter a:"); scanf("%d",&a);
if(a>0) printf("positive"); else printf("negative");
}
include <stdio.h>
int main() { int num; scanf("%d",&num); if (num>0) printf("Positive"); else if (num<0) printf("Negative"); return 0; }
include <stdio.h>
int main() { int num; scanf("%d",&num); if (num>0) printf("Positive"); else if (num<0) printf("Negative"); return 0; }
include <studio.h>
int main() { int num; scanf("%d",&num); if (num>0) printf("Positive"); else if (num<0) printf("Negative"); return 0; }