| #include<bits/stdc++.h>
|
|
|
| using namespace std;
|
|
|
| int main()
|
|
|
| {
|
|
|
| int n,a[n],d;
|
|
|
| cout << "Enter the number of elements for array: ";
|
|
|
| cin >> n;
|
|
|
| cout <<"Enter the elements of array: ";
|
|
|
| for(int i=0; i<n; i++)
|
|
|
| B
|
|
|
| {
|
|
|
| cin>> a[i];
|
|
|
| }
|
|
|
| cout << "Enter the element position that you wanna delete :";
|
|
|
| cin >> d;
|
|
|
| for(int i=d; i <n-1; i++)
|
|
|
| {
|
|
|
| a[i] = a[i+1];
|
|
|
| }
|
|
|
| cout <<"Array after deleting the element:
|
|
|
| for(int i=0; i<n; i++)
|
|
|
| {
|
|
|
| cout<< a[i]<<< " ";
|
|
|
| }
|
|
|
| return 0;
|
|
|
| }
|