Program to insert numbers in array and display them using class.

#include<iostream>
using namespace std;

class array
{
    int a[100],n;
public:
    void insert()
    {
        cout<<"\nEnter number of terms=";
        cin>>n;
        cout<<"\nEnter the numbers=";
        for(int i=0;i<n;i++)
            cin>>a[i];   
    }

    void show()
    {
        cout<<"\nThe numbers are ";
        for(int i=0;i<n;i++)
            cout<<a[i]<<" ";
        cout<<"\n";
    }
};

int main()
{
    array a1;   
    a1.insert();
    a1.show();
    return 0;
}