Output
Enter a number(0-10): 3
3 x 2 x 1
3!= 6
How to code this in java?
import java.util.Scanner;
public class Assign
{
public static void main(String[]args)
{
Scanner n=new Scanner(System.in);
int num=0;
System.out.print("Enter a number(0-10): ");
num=n.nextInt();
for(y=num;y>1;y--)
{
System.out.print(y);
}
}
}
I only have this code. The output:
Enter a number(0-10): 3
321