Challenge: Positive, Negative or Zero

Lab C++ Beginner 10 points

Read one whole number and print positive, negative or zero.

Input

One integer.

Output

One word.

Example

Input

5

Output

positive
Sample input available Sample output available
Editor
C++

Hints

Use if, else if and else.

Zero is neither > 0 nor < 0.

Solution explanation

Three paths, and exactly one of them runs.

Show solution
#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;
    if (n > 0) {
        cout << "positive\n";
    } else if (n < 0) {
        cout << "negative\n";
    } else {
        cout << "zero\n";
    }
    return 0;
}
Output
Answer
HOME LABS COMMUNITY DASHBOARD