Skip to content

Commit 78bfb4f

Browse files
committed
Basic:- Solution to find Sum of Natural Numbers in Ascending Order
1 parent 47d4d04 commit 78bfb4f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package Scaler.Assignments;
2+
import java.util.*;
3+
4+
public class SumOfNaturalNumbers {
5+
public static void main(String[] args) {
6+
Scanner scanner = new Scanner(System.in);
7+
int number = scanner.nextInt();
8+
9+
for(int i = 1; i <= number; i++){
10+
System.out.print(i + " ");
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)