#include <iostream>
using namespace std;
class number
{
int num;
public:
    void getdata();
    void check ();
};
void number::getdata()
{
    cout<<"\n Enter a number";
    cin>>num;
    cout<<num;
}
void number::check()
{
if(num%2==0)
    cout<<"\n Even number";
else
    cout<<"\n odd number";
}
int main()
{
    number n;
    n.getdata();
    n.check();
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: