WAP to ask a number and display its multiplication table.
Answers
Answered by
2
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter N: ");
double n = sc.nextDouble();
for (int i = 1; i <= 10; i++) {
System.out.println(n + " x " + i + " = " + (n*i));
}
}
}
Similar questions