Answer to Question #254146 in Java | JSP | JSF for kitty ku

Question #254146

. Write a Java program that calculates the multiplication table (up to 10) of the randomly generated number (between 1 and 100), and displays that on the screen.

Hint: Math function and For loop. 


1
Expert's answer
2021-10-20T14:29:07-0400


public class App {
	/**
	 * The start point of the program
	 * 
	 * @param args
	 */
	public static void main(String[] args) {


		for (int i = 1; i <= 10; i++) {
			int num = (int) (Math.random() * 101) + 1;
			System.out.printf("%d x %d = %d\n", i, num, num * i);
		}


	}


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS