123456789101112131415161718192021 |
- /**
- * Created by iyasuwatts on 10/17/17.
- */
- import java.util.Scanner;
- public class Main {
-
- public static void Main(String[] args){
- Scanner in = new Scanner(System.in);
- System.out.println("Please enter your number here: ");
-
- int n = in.nextInt();
- int sum = 0;
- for (int i = 1; i <= n; i++){
- sum += i;
-
- }
- System.out.println("The sum of numbers between 1 and " + n + " is " + sum);
- }
- }
-
|