EasyManua.ls Logo

Texas Instruments TI-89 Titanium

Texas Instruments TI-89 Titanium
977 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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
ÊËÌÌÍ

Table of Contents

Other manuals for Texas Instruments TI-89 Titanium

Related product manuals