Monday, 21 July 2014

Java program To Print Multiplication Tables

  1. import java.util.Scanner;
  2. class TablesbyKidshelp
  3. {
  4. public static void main(String args[])
  5. {
  6. int n, c;
  7. System.out.println("Welcome To Tables by Kidshelp & Computerwizardi");
  8. System.out.println("Enter an integer to print it's multiplication table");
  9. Scanner in = new Scanner(System.in);
  10. n = in.nextInt();
  11. System.out.println("Multiplication table of "+n+" is :-");
  12. for ( c = 1 ; c <= 10 ; c++ )
  13. System.out.println(n+"*"+c+" = "+(n*c));
  14. }
  15. }

No comments:

Post a Comment

Breaking