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

C++
1

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;

}
Posted by: Guest on August-27-2021

Code answers related to "how to find if a number is possitive or negative in c++"

Browse Popular Code Answers by Language