123456789101112131415161718192021 |
- /**
- * Created by iyasuwatts on 10/17/17.
- */
- import java.util.*;
- public class Main {
-
- public static void main(String[] args){
-
- Scanner input=new Scanner(System.in);
- System.out.println("Enter the limit");
- int n=input.nextInt();
- int sum=0;
- for(int i=1;i<=n;i++)
- {
- sum=sum+i;
- }
- System.out.printf("\nThe sum is %d",sum);
-
- }
- }
|