public class JZZH { public static void main(String[] args) { int[]arr[]= {{1,2,3},{4,5,6},{7,8,9}}; int i,j; int D=0; for(i=0;i<3;i++) { for(j=0;j<3;j++) { if(i+j<3) { D=arr[i][j]; arr[i][j]=arr[2-i][2-j]; arr[2-i][2-j]=D; } } } for(i=0;i<3;i++) { for(j=0;j<3;j++) { System.out.print(arr[i][j]); System.out.print(" "); } System.out.print(" "); } } }