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


Expert's answer

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!

LATEST TUTORIALS
APPROVED BY CLIENTS