Cmpsc 101, Project : Sum of Integers

Write a program which reads from the keyboard an arbitrary, positive integer number , call it n , and determines the following sum :

(1)    1 + 2 + 3 + ...... + n

using a for-loop.

Have your program also evaluate the fraction :

(2)    n*(n+1)/2

and print out both , the result for equation (1) and for equation (2).

Your program should start with comment lines ( add the appropriate info on each line) :

Name :
ACCESS account ID :
Project Name:
Purpose of program :


Zig Herzog; hgn@psu.edu
Send a Note to Zig
Last revised: 09/15/04