This program written in C++, asks the user to enter a number , then it will decide if the number is positive , negative or zero.
The Code :
#include <iostream>
using namespace std;
void main()
{
signed int x;
cout << "Enter an integer ";
cin >> x;
cout << endl;
if (x == 0)
cout << " Zero Number " << endl;
else if (x < 0)
cout << "Negative Number" << endl;
else if (x > 0)
cout << "Positive Number " << endl;
system("pause");
}
ليست هناك تعليقات:
إرسال تعليق