import java.util.*;
public class InsertElement{
public static void main(String args[]){
int my_arr[]={12,13,14,56,67,89,39,29,10,11};
Scanner sc = new Scanner(System.in);
System.out.println("Enter the index to be replaced");
int index=sc.nextInt();
System.out.println("Enter the element to be indexed");
int new_element=sc.nextInt();
System.out.println("The original array is :"+Arrays.toString(my_arr));
for(int i=my_arr.length-1;i<index;i++){
my_arr[i]=my_arr[i-1];
}
my_arr[index]=new_element;
System.out.println("The updated array is :" +Arrays.toString(my_arr));
}
}