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