Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class JavaClass {
- public static void main(String[] args)
- {
- System.out.println("Enter an integer to print it's multiplication table: ");
- Scanner input = new Scanner(System.in);
- int n = input.nextInt();
- MultiTable(n);
- }
- public static void MultiTable(int num)
- {
- System.out.println("Multiplication table of " + num + " is: ");
- for (int i=1; i<=10; ++i)
- {
- System.out.println(num + "*" + i + " = " + i*num);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement