1public class Main {
2 public static void main(String[] args) {
3 var scanner = new java.util.Scanner(System.in);
4 System.out.print("What is n? ");
5 int n = scanner.nextInt();
6 int sum = 0;
7 for (int i = 1; i <= n; ++i) {
8 sum += i;
9 }
10 System.out.println("The sum of 1..n is " + sum);
11 }
12}