...Just run the program and you'll know whats wrong with it...it gives a -1 value...
#include <iostream.h>
#include <conio.h>
void main()
{
int array[10],key;
cout<<"Enter 10 elements:\n";
for (int c = 0; c < 10; c++)
cin>>array[c];
clrscr();
cout<<"\n List of Elements:";
for ( c = 0 ; c < 10 ; c++ )
{
cout<<" "<<array[c]<<" ";
}
cout<< "\nPlease Enter the index of the number to be deleted:";
cin>>key;
cout<< "\nNew set of elements:";
for ( c = 0 ; c < 10 ; c++ )
{
if(array[c] == key)
{
array[c] = array[c+1];
}
}
cout<<" "<<array[c]<<" ";//Shoud give the list of the new elements where the deleted value wont appear
}
+Using Turbo c++ 4.5 compiler btw+