Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class JavaClass {
  5.  
  6. public static void main(String[] args)
  7. {
  8. System.out.println("Enter an integer to print it's multiplication table: ");
  9. Scanner input = new Scanner(System.in);
  10. int n = input.nextInt();
  11. MultiTable(n);
  12. }
  13.  
  14. public static void MultiTable(int num)
  15. {
  16. System.out.println("Multiplication table of " + num + " is: ");
  17. for (int i=1; i<=10; ++i)
  18. {
  19. System.out.println(num + "*" + i + " = " + i*num);
  20. }
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement