Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

the given is even positive or negative

0 votes
asked Feb 18, 2019 by jeganathan

1 Answer

0 votes
answered Feb 20, 2019 by Jayasurya (180 points)

//C++ program to check whether the inputted number is Even or Odd Positive or Negative or Zero

#include<iostream>
using namespace std;
int main()
{
    int n,rem;
    cout<<"Enter a number : ";
    cin>>n;
    rem=n%2;
    {
        if (rem==0)
        cout<<"The number is Even ";
        else
        cout<<"The number is Odd ";
    }
    cout<<" And ";
    if (n>0)
    cout<<" Positive";
    else if (n<0)
    cout<<" Negative";
    else 
    cout<<" It is Zero";
    
    return 0;
}

commented Feb 21, 2019 by RAHAF YASSIR ALHARBI
you doing great ! keep it up.
commented Feb 21, 2019 by Jayasurya (180 points)
Thanks! I am still a beginner though.. =)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...