Post Reply 
(12C) Sum and Average
10-20-2018, 09:52 AM
Post: #2
RE: (12C) Sum and Average
(10-20-2018 07:28 AM)Gamo Wrote:  Program to find given first n natural number's sum and average.

Nice use of the stack.
But it can be done shorter:

sum = n(n+1)/2
average = sum/n = (n+1)/2

Code:
01 ENTER
02 ENTER
04  1
05  +
06  2
07  รท
08  x
08 LstX
09 GTO 00

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) Sum and Average - Gamo - 10-20-2018, 07:28 AM
RE: (12C) Sum and Average - Dieter - 10-20-2018 09:52 AM
RE: (12C) Sum and Average - Gamo - 10-21-2018, 03:19 AM



User(s) browsing this thread: 1 Guest(s)