Main.java 497B

12345678910111213141516171819202122232425
  1. /**
  2. * Created by iyasuwatts on 10/17/17.
  3. */
  4. import java.util.Scanner;
  5. public class Main {
  6. public static void main(){}
  7. public static void SumOfInput()
  8. {
  9. System.out.println("Please enter a number");
  10. Scanner scanner = new Scanner(System.in);
  11. int number = scanner.nextInt();
  12. int answer = 0;
  13. for(int i = 1; i <= number; i ++)
  14. {
  15. answer += i;
  16. }
  17. System.out.println(answer);
  18. }
  19. }