123456789101112131415161718192021222324 |
- /**
- * Created by iyasuwatts on 10/17/17.
- */
- import java.util.Scanner;
- public class Main {
- int a;
- int b;
-
- public static void main(String[] args){
- Scanner num = new Scanner(System.in);
- System.out.println("Enter Number");
- int a = num.nextInt();
- int sum = 0;
- int b=0;
- while(b<=a){
- sum +=b;
- b++;
-
- }
- System.out.println(sum);
- }
- }
-
|