1int i,k;
2 Scanner sc = new Scanner(System.in);
3 System.out.println("Enter the Number for the table: ");
4
5 int n = sc.nextInt();
6 for (i=1;i<=10;i++){
7 k = n * i;
8 //n + "*" + c + " = " + (n*c))
9 System.out.println(n + "*"+ i + " = " + k);
10 }
1public static String multiTable(int num) {
2 StringBuilder sb = new StringBuilder();
3
4 for (int i = 1; i <= 10; i++) {
5 int result = i * num;
6 sb.append(i + " * " + num + " = " + result + "\n");
7 }
8 return sb.toString().trim();
9 }