Program to delete Elements from given Array in C++



#include
#include

class Array
{
private:int loc1,i,a[20],n;
public:void input();
void delete1();
};

void Array::input()
{
cout<<"\nEnter the Number Of Elements in an array : ";
cin>>n;

cout<<"\nEnter The Elements in an Array :";
for(i=0;i>a[i];

}

void Array::delete1()
{
cout<<"\nEnter the Position from where you want to Delete: ";
cin>>loc1;

for(int j=loc1;j<<"\nUpdated Array is :";
for(i=0;i<=n-1;i++)
cout<<<" ";
}
void main()
{
Array s;
s.input();
s.delete1();
getch();
}

No comments:

Post a Comment