Page 260 - CA_Blue( J )_Class9
P. 260

Write a program to write the table of 1 to 5.
                   Program 15
                                         1      2       3      4      5
                                         2      4       6      8      10
                                         3      6       9      12     15
                                         4      8       12     16     20
                                         5      10      15     20     25

                     1      class table_1_to_5
                     2      {

                     3          public static void main(String args[])
                     4          {
                     5              int max = 5;

                     6              for (int i = 1; i <= max; i++)
                     7                  {

                     8                  for (int j = 1; j <= max; j++)
                     9                  {

                    10                      System.out.print((i*j) + "\t");
                    11                  }

                    12                  System.out.println();
                    13              }

                    14          }
                    15      }


                  You will get the following output:




































                   258    Touchpad Computer Applications-IX
   255   256   257   258   259   260   261   262   263   264   265