Practical Number 2 - 102623
Practical Number 2 - 102623
if(found){
arr[i]= arr[i+1];
}
}
}
int main(){
int n;
cout<<"Enter number of element in array : ";
cin>>n;
int arr[n];
cout<<"Enter elements in array : ";
for(int i=0; i<n; i++){
cin>>arr[i];
}
int pos,ele,op;
cout<<"Press 1 to delete element on the basis of postion and Press 2 to delete
on the basis of element "<<endl;
cin>>op;
if(op == 1){
cout<<"Enter postion : ";
cin>>pos;
deleteByPos(arr,n,pos);
}
else{
cout<<"Enter element : ";
cin>>ele;
deleteByEle(arr,n,ele);
}