Advertisement
wingman007

JavaFactoriel

Nov 15th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1.  
  2. public class Factoriel {
  3.  
  4.     public static void main(String[] args) {
  5.         // TODO Auto-generated method stub
  6.         // communicate with the user View logical layer
  7.         //...TODO
  8.        
  9.         // the business logic (Controller) logical layer
  10.         int factoriel = 1;
  11.         for(int i = 0; i < 10; i++) {
  12.             if(i == 0 || i == 1) factoriel = 1;
  13.             else factoriel *= i;
  14.             System.out.println("Factoriel " + i + "! = " + factoriel);
  15.         }
  16.     }
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement