Universidad Tecnológica de Nezahualcóyotl

Tecnologías de Información y Comunicaciones

Materia:

Curso Propedéutico.

Profesor:

Luis Manuel Martínez Ramírez.

Miércoles 10 de Agosto de 2005

Clase 3: while statement

La programación tiene tres operaciones básicas:

SEQUENCE, DECISION & ITERATION.

ITERATION, que también es while statement es un ciclo que repite procesamiento,

y en el flujo de instrucciones lógicas después de procesar regresa a la condición.

 

Sintaxis del while

Dentro del paréntesis se revisa la CONDICIÓN, en caso de ser verdadera sigue el flujo de la flecha azul, inmediatamente despues regresa con la flecha verde hacia la condición; en caso de ser falsa la condición sigue el flujo de la flecha rosa.

Loops are used to repeat a block of code. You should understand the concept of C++'s true and false, because it will be necessary when working with loops. There is a types of inteligent loop: while statement.

WHILE loops are very simple. The basic structure is...while (true) then execute all the code in the loop. The true represents a boolean expression which could be while (k<n) or while (k<=n). It can be any combination of boolean statements that are legal. Even, (while x==5 || v==7) which says execute the code while x equals five or while v equals 7...

 

Click aquí para revisar los Cyber Apuntes 1

Click aquí para revisar los Cyber Apuntes 2

Hacer la Tarea 1

Sign Guestbook

View Guestbook

Profe Web Site: www.gil-luis.net/luis

E-Mail Prope: [email protected]

 

Hosted by www.Geocities.ws

1 1