Write Program Accept Int User Print Screen Multiplication Table Int Solution Must Use Nest Q37104183

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

Multiplication Table -NetBeans IDE 80.1 Search (Ctrl+1) File Edit View Navigate Source Refactor Ru Debug Profile Team Iools WIf you have any queryregarding the code please ask me in the comment i am here for helpyou. Please do

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.