Showing posts with label Nesting Of Member Functions. Show all posts
Showing posts with label Nesting Of Member Functions. Show all posts

Thursday, December 9, 2010

Nesting Of Member Functions(headerfiles are iostream.h and conio.h

//Program to show nesting of member functions
#include
#include
class set
{int m,n;
public:
void input(void);
[]- ] void display(void);
int largest(void);
};
int set::largest(void)
{
if(m>=n)
return(m);
else
return(n);
}
void set::input(void)
{
cout<<"\nInput values of m &n= ";
cin>>m>>n;
}
void set::display(void)
{
cout<<"Largest value="<}
int main()
{
set a;
a.input();
a.display();

return 0; }

Programming the Whole World!