delete custome index from array c 2b 2b

Solutions on MaxInterview for delete custome index from array c 2b 2b by the best coders in the world

showing results for - "delete custome index from array c 2b 2b"
Alton
07 Jun 2020
1	const int SIZE = 9;
2	int arr[SIZE];
3	cout << "Enter numbers: \n";
4	for (int i = 0; i < SIZE; i++)
5		cin >> arr[i];
6	for (int i = 0; i < SIZE; i++)
7		cout << arr[i] << "\t";
8	cout << endl;
9	
10	cout << "Enter Index U want to delete:\n";
11	int del;
12	cin >> del;
13	for (int i = del-1; i < SIZE; i++)
14	{
15		arr[del] = arr[del + 1];
16		del++;
17	}
18	for (int i = 0; i < SIZE - 1; i++)
19		cout << arr[i] << "\t";
20	cout << endl;