Page 635 - Computer science 868 Class 12
P. 635

37      n1=r;
                   38          }

                   39      }
                   40      return h1;

                   41      }
                   42

                   43      void display()
                   44      {
                   45      swap();

                   46      try

                   47      {
                   48      if(n1==0)
                   49      {

                   50       new Exception("ERROR!Division by zero");
                   51      }

                   52      else
                   53      {

                   54      l=n1*n2;
                   55      h=calculate();

                   56      System.out.println("The HCF is"+h);
                   57      l=l/h;

                   58      System.out.println("The LCM is"+l);
                   59          }

                   60      }
                   61      catch(Exception e)

                   62      {
                   63      System.out.println("e.getMessage()");

                   64              }
                   65          }

                   66      }
                   67

                   68      import java.util.*;
                   69      class hcf_exception_Main
                   70      {





                                                                                                                       633
                                                                                                   Internal Assessment  633
   630   631   632   633   634   635   636   637   638   639   640