Advertisement
Guest User

Untitled

a guest
Sep 24th, 2014
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.21 KB | None | 0 0
  1. public class whileFactorial {
  2.     public static void main(String[] args){
  3.         int n = 5;
  4.         int x = 1;
  5.         int y = 1;
  6.        
  7.         while (y <= n){
  8.             x = x * y;
  9.             y = y + 1;
  10.             System.out.println(x);
  11.        
  12.         }
  13.         }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement