Answers for "java program printsquare"

0

java program printsquare

/*
12345
23451
34512
45123
51234
*/
public static void printSquare(int[]a){
           int temp;
            for (int i = 0; i < a.length; i++) {
                for(int k = 0; k<a.length; k++){
                System.out.print(a[k]);
                }
                System.out.println();
                temp=a[0];
                for(int j=0;j<a.length-1;j++)    
                    a[j]=a[j+1];
                a[a.length-1]=temp;
            }
    }
Posted by: Guest on September-14-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language