Page 325 - Computer science 868 Class 12
P. 325

29                  }
                   30                  System.out.println("");

                   31              }
                   32              System.out.println("The Lower Triangular Matrix is:");
                   33              for( i=0;i<size;i++)

                   34              {

                   35                  for(j=0;j<size;j++)
                   36                  {
                   37                      if(i>=j)

                   38                      {
                   39                          System.out.print(ar[i][j] +" ");

                   40                      }
                   41                      else

                   42                      {
                   43                          System.out.print("0"+" ");

                   44                      }
                   45                  }

                   46                  System.out.println("");
                   47              }

                   48          }
                   49      }


                 The output of the preceding program is as follows:
                 Enter the order of your Matrix
                 Enter the size:
                 3
                 Enter your elements:

                 1 2 3 4 5 6 7 8 9
                 You have entered:
                 1 2 3
                 4 5 6
                 7 8 9
                 The Lower Triangular Matrix is:
                 1 0 0
                 4 5 0
                 7 8 9






                                                                                                                       323
                                                                                                              Arrays   323
   320   321   322   323   324   325   326   327   328   329   330