Etudes/BTS/Java/Premiere annee/FactorielEntier.java

31 lines
644 B
Java
Raw Permalink Normal View History

2016-10-14 15:52:18 +00:00
/*
* 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);
}
}