Page 504 - Cs_withBlue_J_C11_Flipbook
P. 504

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





                502502  Touchpad Computer Science-XI
   499   500   501   502   503   504   505   506   507   508   509