Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class whileFactorial {
- public static void main(String[] args){
- int n = 5;
- int x = 1;
- int y = 1;
- while (y <= n){
- x = x * y;
- y = y + 1;
- System.out.println(x);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement