Program to input 5 numbers and to display its positive and negative divisers of both even and odd numbers respectively:

Program to input 5 numbers and to display its positive and negative divisers
of both even and odd numbers respectively:



Program:

#include < iostream >
using namespace std;
int main()
{
int num;
for(int i = 0 ; i < 5 ; i++)
{
cout << "Enter the number please" << endl;
cin >> num;
if(num % 2 == 0)
{
if(num >= 0)
{
cout << "Possitive even number" << endl;
}
else
{
cout << "Negative even number" << endl;
}
else
{
if(num >= 0)
{
cout << "Possitive odd number" << endl;
}
else
{
cout << "Negative odd number" << endl;
}
}
return 0;
}

Comments

Popular posts from this blog

How to display the output in C++