Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int number;
- do {
- number = input.nextInt();
- if (number == 0) {
- continue;
- }
- int sum = 1;
- int count = 1;
- while (count <= number) {
- sum *= count;
- count++;
- }
- System.out.println(sum);
- } while (number != 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement