Factorial
This is a program to find the factorial of a number import java.io.*; class factorial { long fact(int n) { long f=1; for(int i=1;i<=n;i++) f=f*i; return f; } public void main()throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter the value of m and n"); int m=Integer.parseInt(br.readLine()); int n=Integer.parseInt(br.readLine()); long S=(fact(n)/fact(m))*fact(n-m); System.out.println("The value of S is "+S); }}