Sunday, 24 July 2011

PROGRAM IN C++ to find whether the given number is seven or odd using classes

Do you like this post?
#include
#include
Class evenodd
{
Int a;
Public:
void getdata( )
inline void call()
};
void evenodd::getdata( )
{
cout<<”Enter any number:”; cin>>a;
}
inline void evenodd::call( )
{
if(a%2==0)
cout<<”Number is even”;
else
cout<<”Number is odd”;
}

void main( )
{
evenodd e;
clrscr();
e.getdata( );
e.call( )
getch( );
}

No comments:

Post a Comment