EasyManuals Logo

HP 9g User Manual

HP 9g
87 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
Page #28 background imageLoading...
Page #28 background image
E-28
Each program needs an END command to mark the end of the
program. This is displayed automatically when you create a new
program.
Increment and decrement
Post-fixed: Memory variable + + or Memory variable –
Pre-fixed: +
+ Memory variable or – Memory variable
A memory variable is decreased or increased by one. For standard
memory variables, the + + ( Increment ) and – – ( Decrement ) operators
can be either post-fixed or pre-fixed. For array variables, the operators
must be pre-fixed.
With pre-fixed operators, the memory variable is computed before the
expression is evaluated; with post-fixed operators, the memory variable
is computed after the expression is evaluated.
For loop
FOR
(
start condition; continue condition; re-evaluation
) {
statements
}
A FOR loop is useful for repeating a set of similar actions while a
specified counter is between certain values.
For example:
FOR
( A = 1 ; A
4 ; A + + )
{ C = 3
×
A ; PRINT ANS = , C }
END
Result : ANS = 3, ANS = 6, ANS = 9, ANS = 12
The processing in this example is:
1. FOR A = 1: This initializes the value of A to 1. Since A = 1 is consistent
with A
4, the statements are executed and A is incremented by 1.
2. Now A = 2. This is consistent with A
4, so the statements are
executed and A is again incremented by 1. And so on.
3. When A = 5, it is no longer true that A
4, so statements are not
executed. The program then moves on to the next block of code.
Sleep command
SLEEP (
time
)
A SLEEP command suspends program execution for a specified time
(up to a maximum of 105 seconds). This is useful for displaying
intermediate results before resuming execution.
Swap command
SWAP (
memory variable A, memory variable B
)

Table of Contents

Other manuals for HP 9g

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP 9g and is the answer not in the manual?

HP 9g Specifications

General IconGeneral
Digits- digits
Display typeLCD
Display tiltingNo
Display number of lines- lines
TypeGraphing
Cover-
Form factorDesktop
Control typeButtons
Product colorBlack
Battery typeGP-76A
Power sourceBattery
Weight and Dimensions IconWeight and Dimensions
Depth155 mm
Width81 mm
Height13.7 mm

Related product manuals