Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Kertoma {
- public static void main(String[] args) {
- Scanner lukija = new Scanner(System.in);
- System.out.println("Anna luku:");
- int n = Integer.valueOf(lukija.nextLine());
- int kertoma = 1;
- int luku = 1;
- while (luku <= n) {
- kertoma *= luku;
- luku++;
- }
- System.out.println("Kertoma on " + kertoma);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement