Skip to content

Factorial  #1

Description

@Vinuthnavadikari

import java.util.*;

class Main
{
public static long factorial(int n) {
if (n == 0 || n == 1) {
return 1;
}
return n * factorial(n - 1);
}

public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
long fact1 = factorial(n);
long fact2 = factorial(m);
long ans = ((fact1)/(fact2));
System.out.println(ans);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions