17211
26
Zoom out
Zoom in
Previous page
1/82
Next page
S-26
( Decremento ) pueden ser de incremento o decremento posterior o
anterior. Para variables de matriz, los operadores deben ser de
incremento o decremento anterior.
Con los operadores de incremento o decremento anterior, la variable de
memoria se calcula cuando se evalúa la expresión; con los operadores
de incremento o decremento posterior, la variable de memoria se
calcula tras evaluar la expresión.
Bucle For
FOR
(
condición inicial; condición de continuación; reevaluación
)
{
instrucciones
}
Un bucle FOR es útil para repetir un conjunto de acciones similares
mientras un contador especificado esté entre determinados valores.
For ejemplo:
FOR
( A = 1 ; A
4 ; A + + )
{ C = 3 x A ; PRINT ANS = , C }
END
Resultado: ANS = 3, ANS = 6, ANS = 9, ANS = 12
En este ejemplo, el procesamiento es el siguiente:
1. FOR A = 1: esto inicializa el valor de A como 1. Como A = 1 es
coherente con A
4, las instrucciones se ejecutan y A se incrementa en
una unidad.
2. Ahora A = 2. Esto es coherente con A
4, por lo que se ejecutan las
instrucciones y se vuelve a incrementar el valor de A en una unidad. Y
así sucesivamente.
3. Cuando A = 5, A
4 deja de ser verdadero, por lo que no se
ejecutarán las instrucciones. El programa pasará al siguiente bloque de
código.
Comando Sleep
SLEEP (
tiempo
)
Un comando SLEEP suspende la ejecución del programa durante un
tiempo especificado (hasta 105 segundos como máximo). Esto resulta
útil para visualizar resultados intermedios antes de reanudar la
ejecución.
Comando Swap
SWAP (
variable de memoria A, variable de memoria B
)
El comando SWAP intercambia el contenido de dos variables de
memoria.
Operadores relacionales
Los operadores relacionales que se pueden utilizar en bucles FOR y en
bifurcación condicional son:
= = (igual que), < (menor que), > (mayor que),
(distinto de),
(menor
o igual que),
(mayor o igual que).
Crear un programa nuevo
26


Need help? Post your question in this forum.

Forumrules


Report abuse

Libble takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.

Product:

For example, Anti-Semitic content, racist content, or material that could result in a violent physical act.

For example, a credit card number, a personal identification number, or an unlisted home address. Note that email addresses and full names are not considered private information.

Forumrules

To achieve meaningful questions, we apply the following rules:

Register

Register getting emails for HP 9g at:


You will receive an email to register for one or both of the options.


Get your user manual by e-mail

Enter your email address to receive the manual of HP 9g in the language / languages: Spanish as an attachment in your email.

The manual is 2,77 mb in size.

 

You will receive the manual in your email within minutes. If you have not received an email, then probably have entered the wrong email address or your mailbox is too full. In addition, it may be that your ISP may have a maximum size for emails to receive.

Others manual(s) of HP 9g

HP 9g User Manual - English - 172 pages


The manual is sent by email. Check your email

If you have not received an email with the manual within fifteen minutes, it may be that you have a entered a wrong email address or that your ISP has set a maximum size to receive email that is smaller than the size of the manual.

The email address you have provided is not correct.

Please check the email address and correct it.

Your question is posted on this page

Would you like to receive an email when new answers and questions are posted? Please enter your email address.



Info