//E.M.C was here for Java 9th period
import java.util.*;
public class numSum
{
public static void main (String [] args)
{
//Variables will be declared!
Scanner input = new Scanner (System.in);
int numb, start;
System.out.print ("Input a number:");
numb = input.nextInt ();
//Printing of the number...
while (numb >= 1)
{
System.out.println (numb);
numb --;
}
}
}
The assignment is: Create a NumbersSum application that prompts the user for a number and then displays the numbers 1 through the number entered, each on a separate line. Below the numbers, the sum is displayed.
I am having trouble with finding the sum of all the numbers. :( What is a good way to do that? Will anyone show and explain how to do it, please? :confused:


Sign In
Create Account


Back to top









