Java Factorial factorial(int n)

Here you can find the source of factorial(int n)

Description

factorial

License

Open Source License

Parameter

Parameter Description
n a parameter

Declaration

public static int factorial(int n) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from   w  w w  .  jav a  2  s.  c o  m
     * @param n
     * @return
     */
    public static int factorial(int n) {
        int f = 1;
        for (int i = 1; i <= n; i++) {
            f *= i;
        }
        return f;
    }
}

Related

  1. factorial(int n)
  2. factorial(int n)
  3. factorial(int n)
  4. factorial(int n)
  5. factorial(int n)
  6. factorial(int n)
  7. factorial(int n)
  8. factorial(int n)
  9. factorial(int n)