Page 456 - computer science (868) class 11
P. 456

62                   {
                63                       System.out.print(ar[i][j]+"\t");

                64                   }
                65                   System.out.println();

                66               }
                67           }

                68
                69           public static void main()
                70           {//start of main

                71               rowcolsum ob = new rowcolsum();

                72               ob.input();
                73               ob.display();
                74               ob.row_sum();

                75               ob.col_sum();
                76           }//end of main

                77       }//end of class


              The output of the preceding program is as follows:
              Number of rows : 3
              Number of columns : 3
              Enter the element in the array : 1
              Enter the element in the array : 2
              Enter the element in the array : 3
              Enter the element in the array : 4
              Enter the element in the array : 5
              Enter the element in the array : 6
              Enter the element in the array : 7
              Enter the element in the array : 8
              Enter the element in the array : 9
              1   2   3
              4   5   6
              7   8   9


              The sum of row : 0 : 6
              The sum of row : 1 : 15
              The sum of row : 2 : 24
              The sum of column : 0 : 12
              The sum of column : 1 : 15
              The sum of column : 2 : 18





                454454  Touchpad Computer Science-XI
   451   452   453   454   455   456   457   458   459   460   461