Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package skola;
- import java.util.Scanner;
- /**
- *
- * @author Felix 1
- */
- public class Uppgift86 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Scanner inmatning = new Scanner(System.in);
- System.out.print("n: ");
- int n = inmatning.nextInt();
- int summa = 1;
- for(int i = 1; i <= n; i++)
- {
- summa *= i;
- if(i == n)
- {
- System.out.print(i + " = " + summa);
- }
- else
- System.out.print(i + " * ");
- }
- }
- }
Add Comment
Please, Sign In to add comment