Programming
624
Example 4
This example uses built-in functions to calculate the result without using a loop.
Ê
Prompts for input on Program I/O.
Ë
Calculates sum.
Ì
Displays output on Program I/O screen.
Note:
Because
Input
returns
n
as a number, you do not need to use
expr
to convert
n
.
Ê
Ë
Ì
:prog4()
:Prgm
:Input "Enter an integer",n
:sum(seq(i,i,1,n))
!
temp
:Disp temp
:EndPrgm
Function
Used in this example to:
seq
Generate the sequence of integers from
1
to
n
.
sum
Sum the integers in the list generated by
seq
.
seq(
expression
,
var
,
low
,
high
[,
step
]
)
Ê
expression used to generate the sequence
Ë
variable that will be incremented
Ì
initial and final values of
var
Í
increment for
var
; if omitted, uses 1
Ê
Ë
Ì Ì
Í
Summary of Contents for Titanium TI-89
Page 9: ...Getting Started 6 TI 89 Titanium keys Ë Ì Í Ê ...
Page 34: ...Getting Started 31 2 or D 2 B u s i n e s s D B D B Press Result ...
Page 43: ...Getting Started 40 3 0 D B D D B D Press Result ...
Page 44: ...Getting Started 41 D 2 0 0 2 D B Scroll down to October and press Press Result ...
Page 58: ...Getting Started 55 Example Set split screen mode to TOP BOTTOM Press Result 3 B D ...
Page 70: ...Getting Started 67 ...
Page 175: ...Operating the Calculator 172 From the Keyboard ...
Page 456: ...Tables 453 ...
Page 527: ...Data Matrix Editor 524 ...