please answer it.....
Attachments:
Answers
Answered by
0
import java.util.*;
public class Main
{
public static void main(String args[])
{
Scanner ob=new Scanner(System.in);
int a, fact=1;
System.out.println("Enter a number:");
a=ob.nextInt();
for(int i=1;i<=a;i++)
{
fact=fact*i;
}
System.out.println("The factorial of a number:"+fact);
}
}
Mark me as brainliest
Similar questions
Accountancy,
5 months ago
Computer Science,
5 months ago
Math,
5 months ago
Hindi,
10 months ago
English,
10 months ago
Math,
1 year ago