Assignemnt #88 Adding

Code

    /// Name: Caelan Dorstad
    /// Period: 6
    /// Program Name: add
    /// File Name: add.java
    /// Date Finished: 2/25/2016
    
    import java.util.Scanner;

    public class add{
        public static void main(String[] args){
            int value;
            int total=0;
            Scanner keyboard = new Scanner(System.in);
            System.out.print("Count to: ");
            value = keyboard.nextInt();
            
            for ( int n=1; n <= value; n++){
                System.out.print(n+" ");
                
                total += n;
            }
            System.out.println();
            
            System.out.println("Total: "+total);
        }
    }
            
                               

    

Picture of the output

Assignment 10