You are to write a program that will accept an int from the userand print to the screen the multiplication table for that int. Yoursolution MUST use a nested loop. in java
Solution
Code
import java.util.Scanner;
public class MultiplicationTable {
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.print(“Enter number:”);
int n=s.nextInt();
for(int i=1; i <= 10; i++)
{
System.out.println(n+” * “+i+” = “+n*i);
}
}
}
ouptut
If you have any queryregarding the code please ask me in the comment i am here for helpyou. Please do
OR
OR