DSPS: ODD 'o' EVEN
//============================================================================
// Name : Odd_even.cpp
// Author : Parashar
// Version :
// Copyright : Do not try this at home ;P
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
class number
{
public:
int a,c;
public:
void getdata();
void process();
};
void number::getdata()
{
cout<<"enter a number";
cin>>a;
}
void number::process()
{
c=a%2;
if(c==0)
{
cout<<"the number is even";
}
else
{
cout<<"the number is odd";
}
}
int main()
{
cout << "Made by PARASHAR" << endl;
number n;
n.getdata();
n.process();
return 0;
}
// Name : Odd_even.cpp
// Author : Parashar
// Version :
// Copyright : Do not try this at home ;P
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
class number
{
public:
int a,c;
public:
void getdata();
void process();
};
void number::getdata()
{
cout<<"enter a number";
cin>>a;
}
void number::process()
{
c=a%2;
if(c==0)
{
cout<<"the number is even";
}
else
{
cout<<"the number is odd";
}
}
int main()
{
cout << "Made by PARASHAR" << endl;
number n;
n.getdata();
n.process();
return 0;
}
Comments
Post a Comment