Program to Illustrate The Concept Of Nesting :
#include<iostream>
using namespace std;
class nest
{
int x,y;
public:
void getdata()
{
cout<<"\n Enter The Values\n";
cin>>x>>y;
}
void display()
{
getdata();
cout<<"\nValues You Entered Are\n";
cout<<x<<"\n"<<y;
}
};
main()
{
nest a;
a.display();
}
#include<iostream>
using namespace std;
class nest
{
int x,y;
public:
void getdata()
{
cout<<"\n Enter The Values\n";
cin>>x>>y;
}
void display()
{
getdata();
cout<<"\nValues You Entered Are\n";
cout<<x<<"\n"<<y;
}
};
main()
{
nest a;
a.display();
}