📌  相关文章
📜  如何在c ++代码示例中查找数字是正数还是负数

📅  最后修改于: 2022-03-11 14:44:57.768000             🧑  作者: Mango

代码示例1
#include

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;

}