#include <iostream>
using namespace std;
void sample()
{
class oddeven
{
public :
int a;
void getdata()
{
cout <<"Enter the number: ";
cin>>a;
cout <<a<<endl;
}
void find ()
{
if (a%2==0)
cout <<"The given number is even "<<endl;
else
cout <<"The given number is odd "<<endl;
}
}s;
s. getdata();
s. find();
}
int main() {
sample();
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: