12345678910111213141516171819202122232425 |
- /**
- * Created by iyasuwatts on 10/17/17.
- */
-
-
- import java.util.*;
- public class Main {
-
- public static void main(String[] args){
- Scanner in = new Scanner(System.in);
-
- int sum=0;
- System.out.println("Enter the number");
-
- int num=in.nextInt();
-
- for(int i=1; i<= num; i++)
- {
- sum= sum+ i;
-
- }
- System.out.println("Sum of the number is " + sum);
- }
- }
|