Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. public class Mathe
  2. {
  3.     public Mathe()
  4.     {
  5.         fakultaet(10);
  6.     }
  7.    
  8.     public static void main(String[] args)
  9.     {
  10.         new Mathe();
  11.     }
  12.    
  13.     public long fakultaet(int n)
  14.     {
  15.         if(n == 0)
  16.         {
  17.             return 1;
  18.         }
  19.        
  20.         long start = 1;
  21.        
  22.         for(int i = 1; i <= n; i++)
  23.         {
  24.             start *= i;
  25.             System.out.println(start);
  26.         }
  27.        
  28.         return start;
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement