Reverse coping array element

 

package quiz;

public class RotaionArray {

    public static void main(String[] args) {

        

    

    int A[]= {1,2,3,4,5,6,7,8,9,10};

    int B[]=new int[10];

        System.out.print(“B:”);

    for(int i=A.length-1,j=0;i>=0;i–,j++){

        B[j]=A[i];

        System.out.print(B[j]+”,”);

      }

            

    }

    

}

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top