Descargar la presentación
La descarga está en progreso. Por favor, espere
1
Estructura de Repetición C++
Prof. Carlos Rodríguez Sánchez
2
while Structure Formato: while (expression) statement (s)
3
while Structure Flujograma T Logical expression statement F
4
while Structure Ejemplo: considere el siguiente segmento de un programa en C++ int i = 0; while ( i <= 20) { cout << i << “ “; i = i + 5; } cout << endl; start i = 0 T i > 20 stop F i i = i + 5
5
while Structure Output:
6
for Structure Formato:
for (initial statement; loop condition; update statement) statement (s) Initial expression t Update expression Logical expression statement f
7
for Structure Ejemplo: considere el siguiente segmento de un programa en C++ for (int i = 0; i <= 20; i = i + 5) cout << i << “ “; cout << endl; Output:
8
do … while Structure Formato: do statement (s) while (expression);
9
do … while Structure Ejemplo (siguiendo los anteriores): int i = 0; do
{ cout << i << “ “; i = i + 5; } while (i <= 20);
Presentaciones similares
© 2024 SlidePlayer.es Inc.
All rights reserved.