Page 597 - ComputerScience_Class_11
P. 597

28              int b[][] = new int[n][n];

                   29               for(int i = 0; i < n; i++)
                   30               {

                   31                  q = n-1;
                   32                  for(int j = 0; j < n; j++)

                   33                  {
                   34                      b[p][q] = a[i][j];

                   35                      q--;
                   36                  }

                   37                  p++;
                   38              }

                   39              System.out.println("ORIGINAL MATRIX");
                   40              for(int i = 0; i < n; i++){
                   41                  for(int j = 0; j < n; j++){

                   42                      System.out.print(a[i][j] + "\t");

                   43                  }
                   44                  System.out.println();
                   45              }

                   46              System.out.println("MIRROR MATRIX");
                   47              for(int i = 0; i < n; i++){

                   48                  for(int j = 0; j < n; j++){
                   49                      System.out.print(b[i][j] + "\t");

                   50                  }
                   51                  System.out.println();

                   52              }
                   53          }

                   54          public static void main(String args[])
                   55          {

                   56              Mirror_matrix ob=new Mirror_matrix();
                   57              ob.input();

                   58              ob.mirror();;
                   59          }

                   60      }








                                                                                                Internal Assessment  595
   592   593   594   595   596   597   598   599   600   601   602