java program to display multiplication table code example
Example: Multiplication table for number Java
public static String multiTable(int num) {
StringBuilder sb = new StringBuilder();
for (int i = 1; i <= 10; i++) {
int result = i * num;
sb.append(i + " * " + num + " = " + result + "\n");
}
return sb.toString().trim();
}