Here you can find the source of factorial(int n)
Parameter | Description |
---|---|
n | a parameter |
public static int factorial(int n)
//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; } }