Write a program to print the sum of n natural numbers ( where n signifies the range 1 to n )
import java.util.*;
public class sumn {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
int sum=0;
System.out.println(" ENTER THE RANGE : ");
int n = sc.nextInt();
for(int i=1; i<=n;i++)
sum+=i;
System.out.println("SUM : "+sum);
}
}