This program is supposed to ask the user to input a number and the print will read out the factorial. This code is wrong how do I fix it? Maybe not add much just jumbled up variables? Help! This was given to me created in BLUE J software
i know the reader should equal the number
and for (x=number, x<=1;x++) but im not sure..
import java.io.*;
import java.util.*;
class Problem3
{
public static void main(String args[])
{
Scanner aReader = new Scanner(System.in);
System.out.print("Enter an integer you want to find the factorial for ");
int a = aReader.nextInt();
int fact=1;
for (inti=1;1<=a;i++)
fact=fact*i;
{
System.out.println(fact);
}
}
}