Tuesday, December 10, 2013

Display the multiplication table of the number entered by the user in Java


  import java.util.Scanner;

  class addInteger{

  public static void main( String [ ] args )
  {
  Scanner in =new Scanner ( System.in );
  System.out.println("Enter first number:");
  int a=in.nextInt();
  System.out.println("Second number:");
  int b=in.nextInt();
  int c=a+b;
  System.out.println("The sum is :" + c);
  }

  }

0 comments:

Post a Comment