Computer Science, asked by saikrishnakavuri591, 2 months ago

Factorial
Write a program to print the factorial of N.
Factorial is the product of all positive integers less than or equal to N.

Answers

Answered by BrainlyProgrammer
11

Answer:

//java program to print the factorial

import java.util.*;

class Fact{

public static void main(String ar[]) {

Scanner sc =new Scanner (System.in) ;

int n=sc.nextInt(); //Enter a number

int f=1;

for(int I=1;I<=n;I++)

f * =i;

System.out.println("Factorial"+f) ;

}

}

Similar questions