Main.java 447B

1234567891011121314151617181920212223
  1. /**
  2. * Created by iyasuwatts on 10/17/17.
  3. */
  4. import java.util.Scanner;
  5. public class Main {
  6. public static void main(String[] args){
  7. Scanner input = new Scanner(System.in);
  8. System.out.println( "Give Ending Value:");
  9. int num = input.nextInt();
  10. int result = 0;
  11. for( int i = 1; i <= num; i++){
  12. result += i;
  13. }
  14. System.out.println(result);
  15. }
  16. }