Assignment 88
Code
/// Gian Adoremos
/// Period: 7
/// Program Name: EightyEighth Program
/// File Name: SuperSum.java
/// Date Finished: 1/14/2016
import java.util.Scanner;
public class SuperSum
{
public static void main( String[] args )
{
Scanner key = new Scanner(System.in);
System.out.println("count to: ");
int t = key.nextInt(),s=0;
for ( int n = 1 ; n <= t ; n = n+1 )
{
s = s + n;
System.out.print( n + " ");
}
System.out.println("");
System.out.println("The sum is " + s + ".");
}
}
Picture of the output