Positive or Negative


Submit solution

Points: 20 (partial)
Time limit: 10.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
C

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


  • 1
    CBENU4EEE20141  commented on May 26, 2021, 2:52 p.m.

    include <stdio.h>

    int main() { int a; printf("enter a:"); scanf("%d",&a);

    if(a>0) printf("positive"); else printf("negative");

    return 0;

    }


  • 1
    MANISH_A  commented on May 26, 2021, 2:51 p.m.

    include <stdio.h>

    int main() { int num; scanf("%d",&num); if (num>0) printf("Positive"); else if (num<0) printf("Negative"); return 0; }


  • 0
    MANISH_A  commented on May 26, 2021, 2:51 p.m.

    include <stdio.h>

    int main() { int num; scanf("%d",&num); if (num>0) printf("Positive"); else if (num<0) printf("Negative"); return 0; }


  • 0
    MANISH_A  commented on May 26, 2021, 2:47 p.m.

    include <studio.h>

    int main() { int num; scanf("%d",&num); if (num>0) printf("Positive"); else if (num<0) printf("Negative"); return 0; }