Write a function to print a table of a number
Answers
Answered by
0
Answer:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
System.out.print("Enter a number:");
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
System.out.println("Tables of " + x);
for(int i = 1; i <= 10; i++){
System.out.println(x + " x " + i + " = " + (x*i));
}
}
}
Explanation:
Similar questions