Answer to Question #254845 in Java | JSP | JSF for Monte

Question #254845

Using a while loop create a program that will prompt the user for a positive number and then print out a multiplication list of all the between the given number and one(inclusive), These are referred to as the factorial and it is only applicable for positive numbers, see link for more


1
Expert's answer
2021-10-22T00:49:14-0400
import java.util.Scanner;
public class Main{
public static void main(String args[]){
    Scanner input=new Scanner(System.in);
    int x;
    System.out.print("Input a number: ");
    x=input.nextInt();
    int y=1;
    while( y<=10){
    System.out.println(x+"x"+y+"="+x*y);
     y++;
            }
        }
    }

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