Casio fx-5800P User Manual page 118

Casio calculator user's guide fx-5800p
Hide thumbs Also See for fx-5800P:
Table of Contents

Advertisement

For ~ To ~ Step ~ Next
For <expression (start value)> → <variable (control variable) >
Syntax
To <expression (end value)> Step <expression (step value)> : <statement> :
... <statement> : Next : ...
Function
Execution of the statements from For to Next repeats as the control variable
is incremented by the step amount with each execution, starting from the
starting value. Except for that, this command is the same as For~To~Next.
For 1 → A To 10 Step 0.5 : A
Example
A Control Structure Commands: While Statements
While ~ WhileEnd
Syntax
While <conditional statement> : <statement> : ... <statement> : WhileEnd : ...
Function
The statements from While to WhileEnd are repeated while the conditional
expression following While is true (non-zero). When the conditional
expression following While becomes false (0), the statement following
WhileEnd is executed.
? → A : While A < 10 : A
Example
Note
• If the condition of the While statement is false the fi rst time this command
is executed, execution jumps directly to the statement following WhileEnd
without executing the statements from While to WhileEnd even once.
• To input the WhileEnd command, select "W·End" on the function menu.
Do ~ LpWhile
Syntax
Do : <statement> : ... <statement> : LpWhile <conditional statement>
Function
The statements from Do to LpWhile are repeated while the conditional
expression following LpWhile is true (non-zero). Since the condition is
assessed following execution of LpWhile, the statements from Do to LpWhile
are executed at least once.
Do : ? → A : A × 2 → B : B
Example
Note
To input the LpWhile command, select "Lp·W" on the function menu.
A Subroutine Call Commands
Prog
Syntax
... : Prog "fi le name" : ...
2
→ B : B
Next
2
A + 1 → A : WhileEnd : A ÷ 2
LpWhile B > 10
E-117
(COMP)
(COMP)
(COMP)
/ )
(

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents