Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to find if a number is possitive or negative in c++

#include<iostream>

using namespace std;

int main ()

{

    int num;

    cout << "Enter the number to be checked : ";

    cin >> num;

    if (num >= 0)

        cout << num << " is a positive number.";

    else 

        cout << num << " is a negative number.";

    return 0;

}
 
PREVIOUS NEXT
Tagged: #find #number #possitive #negative
ADD COMMENT
Topic
Name
6+8 =