Assignemnt #88 and Adding Values
Code
///name: Ben Borglin
///Period: 6
///Program name: Adding Values
///File Name: AddValues.java
///Date Finished: 11/2/15
import java.util.Scanner;
public class AddValues
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int s, n, t;
t = 0;
System.out.print("Number: ");
n = keyboard.nextInt();
for (s = 1; s <= n; s = s + 1)
{
System.out.println(s);
t = t + s;
}
System.out.println("Your total was " + t);
}
}
Picture of the output