123456789101112131415161718
  1. //Lauren
  2. import java.util.Scanner;
  3. public class Main {
  4. public static void main(String[] args){
  5. Scanner in = new Scanner(System.in);
  6. System.out.print("Please enter a positive whole number.");
  7. int n = in.nextInt();
  8. int total = 0;
  9. for (int i = 1 ; i <= n ; i++) {
  10. total = total + i;
  11. }
  12. System.out.print(total);
  13. }
  14. }