Etudes/BTS/Java/Premiere annee/FactorielEntier.java
2016-10-14 17:52:18 +02:00

31 lines
644 B
Java

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package factorielentier;
/**
*
* @author therbron
*/
public class FactorielEntier {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int entier = 20;
long resultat = 1;
for(int i = entier; i >= 1; i--)
{
resultat = resultat * i;
}
System.out.println(resultat);
}
}