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);
}
}
}

You have inti it should be int.

and 1<=a should be i<=a, and I rearranged the braces as well.

for (inti=1;1<=a;i++)
{
fact=fact*i;
}
System.out.println(fact);

this is what it should be:

for (int i = 1; i <=a; i++)
{
fact=fact*i;
}
System.out.println(fact);
This question has already been answered. Start a new discussion instead.