i want to delete a element from the array
i use this logic but it is not working
#include<iostream.h>
#include<conio.h>
main()
{
int arr[5]; //10 element int array
int key; // key to edit
int length=5; //length of array
clrscr();
for(int i=0; i<length ; i++)
{
cin>>arr[i];
}
cout<<"Enter item no u want to del";
cin>>key;
for(i=0; i<length ; i++)
{
if(arr[i] == key)
{
arr[i] = arr[i+1];
}
}
for(int i=0; i<length ; i++)
{
cout<<arr[i];
}
getch();
}