--
Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2002): Can't connect to local server through socket '/var/lib/mysql/mysql.sock' (2) in /home/itprojectsco/public_html/includes/database.php on line 13
Ready Project |BCA Project | MCA Project | BBA Project | MBA Project |INDIA'S BIGGEST COLLEGE PROJECT STORE
import java.io.*;
class NumberZero extends Exception
{
      NumberZero()
      {}
}
class Number
{
      static int no;
      Number() throws IOException
      {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            System.out.println("Enter no");
            no=Integer.parseInt(br.readLine());
            try
            {  
   if(no==0)
                  {
                  throw new NumberZero();
                  }
            cal();
            }//end of try
            catch(NumberZero e)
            {
                  System.out.println("no is zero");
            }
      }
      void cal() 
      {   
  int l=0,r=0;
            l = no%10;
            //System.out.println("no = "+no);
            if(no>9)
            {
                  while(no>0)
                  {
                  r = no%10
                  }
            System.out.println("Addotion of first and last digit = "+(l+r));
                              }
            else
            System.out.println("Addotion of first and last digit = "+l);
      }
}
class Slip19
{
      public static void main(String a[]) throws IOException
      {   
  Number n= new Number();
      }
}

Search

Project Categories


    Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/itprojectsco/public_html/includes/sidebar.php on line 30

    Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /home/itprojectsco/public_html/includes/sidebar.php on line 32

Recent Posts


Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/itprojectsco/public_html/includes/widget.php on line 5

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /home/itprojectsco/public_html/includes/widget.php on line 7

Sign In