Friday, September 23, 2016

Nesting of Member Function

Tags

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();
}