wap to accept a number and print its table
Answers
Answered by
3
import java.util.Scanner;
public class PrintTable {
public static void main(String [] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter a number : ");
int num = sc.nextint();
System.out.println (" Table of " + num);
for (int i = 1; I <= 10; i++) {
System.out.println(num + " × " + i + " = " + (i * num));
}
sc.close();
}
}
Similar questions