/** * Created by iyasuwatts on 10/17/17. */ import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.println( "Give Ending Value:"); int num = input.nextInt(); int result = 0; for( int i = 1; i <= num; i++){ result += i; } System.out.println(result); } }