Question: 1.Write a program that uses a method to calculate and return the sum of the first N integers . There is a math formula for
1.Write a program that uses a method to calculate andreturn the sum of the first N integers. There is a math formula for this but your methodmust use a loop. Allow the user to enter the value of N in the main method.
Sample Output(input in italics)
Enter the integer15
The sum of the first 15 integers is 120
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
