<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
	<id>https://www.ecured.cu/index.php?action=history&amp;feed=atom&amp;title=Estructuras_de_Control%3A_Iteraciones</id>
	<title>Estructuras de Control: Iteraciones - Historial de revisiones</title>
	<link rel="self" type="application/atom+xml" href="https://www.ecured.cu/index.php?action=history&amp;feed=atom&amp;title=Estructuras_de_Control%3A_Iteraciones"/>
	<link rel="alternate" type="text/html" href="https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;action=history"/>
	<updated>2026-04-18T04:51:52Z</updated>
	<subtitle>Historial de revisiones para esta página en el wiki</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=3580705&amp;oldid=prev</id>
		<title>Carlos idict: Revertidos los cambios de Javier martinez1867 (disc.) a la última edición de Lajas1 jc</title>
		<link rel="alternate" type="text/html" href="https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=3580705&amp;oldid=prev"/>
		<updated>2019-11-15T11:23:28Z</updated>

		<summary type="html">&lt;p&gt;Revertidos los cambios de &lt;a href=&quot;/Especial:Contribuciones/Javier_martinez1867&quot; title=&quot;Especial:Contribuciones/Javier martinez1867&quot;&gt;Javier martinez1867&lt;/a&gt; (&lt;a href=&quot;/Usuario_discusi%C3%B3n:Javier_martinez1867&quot; title=&quot;Usuario discusión:Javier martinez1867&quot;&gt;disc.&lt;/a&gt;) a la última edición de &lt;a href=&quot;/Usuario:Lajas1_jc&quot; title=&quot;Usuario:Lajas1 jc&quot;&gt;Lajas1 jc&lt;/a&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisión del 11:23 15 nov 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l25&quot; &gt;Línea 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Una de las características importantes que se pueden aprovechar de las [[computadora]]s es precisamente su capacidad de repetir la ejecución de [[secuencias de instrucciones]] a una gran velocidad y con alto grado de confiabilidad.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Una de las características importantes que se pueden aprovechar de las [[computadora]]s es precisamente su capacidad de repetir la ejecución de [[secuencias de instrucciones]] a una gran velocidad y con alto grado de confiabilidad.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para estos fines, precisamente se definen en los [[lenguajes de programación]] las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una [[secuencia de instrucciones]], a estas estructuras se les denomina ciclo, lazo o bucle. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para estos fines, precisamente se definen en los [[lenguajes de programación]] las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una [[secuencia de instrucciones]], a estas estructuras se les denomina ciclo, lazo o bucle. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==En la vida diaria existen situaciones que frecuentemente se resuelven realizando una determinada secuencia de pasos que puede repetirse muchas veces, ejemplo:==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Estructuras de Control Iterativas == &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;En la vida diaria existen situaciones que frecuentemente se resuelven realizando una determinada secuencia de pasos que puede repetirse muchas veces, ejemplo: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* El proceso que seguimos para comer, mientras no se termine la comida.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* El proceso de insertar monedas, hasta que se abone la cantidad necesaria.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* Las operaciones que realizamos para llamar por teléfono, mientras no se logre la comunicación. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Como se puede observar estos son algoritmos que se hacen cotidianamente, pero tienen la particularidad de que la ejecución de alguno de sus pasos puede repetirse muchas veces, mientras no se logre la meta trazada. A este tipo de algoritmo se le conoce como algoritmos iterativos o repetitivos. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;En [[C#]], las instrucciones while, do/while, y for, permiten ejecutar iteraciones, bucles o ciclos. En cada caso se ejecuta un bloque de instrucciones mientras la condición que se evalúa tome valor verdadero. Se resalta que cualquiera de las 3 instrucciones cumple con el mismo objetivo que es el de ejecutar una secuencia de pasos, más de una vez.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;== La instrucción while &lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;La instrucción while tiene la siguiente sintaxis:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Archivo:InstruccionWhile.JPG]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;El proceso que seguimos para comer, &lt;/del&gt;mientras &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;no &lt;/del&gt;se &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;termine la comida&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;La semántica de la instrucción es la siguiente:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;El &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;proceso &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;insertar monedas, hasta &lt;/del&gt;que se &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;abone la cantidad necesaria&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &amp;lt;condición&amp;gt;. Está representada por una expresión booleana y &lt;/ins&gt;mientras se &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;cumpla se ejecutará el ciclo&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Las operaciones que realizamos para llamar por teléfono&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;mientras no &lt;/del&gt;se &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;logre &lt;/del&gt;la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;comunicación&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* [Bloque de Instrucciones] &lt;/ins&gt;El &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;bloque de instrucciones puede estar formado por una o varias instrucciones y es el conjunto &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pasos &lt;/ins&gt;que se &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;van ejecutar en cada iteración del ciclo.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Como &lt;/del&gt;se &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;puede observar estos son algoritmos &lt;/del&gt;que &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;se hacen cotidianamente, pero tienen &lt;/del&gt;la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;particularidad de &lt;/del&gt;que la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ejecución de alguno de sus pasos puede repetirse muchas veces&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;mientras &lt;/del&gt;no &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;se logre la meta trazada&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;A este tipo &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;algoritmo se le conoce como algoritmos iterativos o repetitivos. En C#, las instrucciones while, &lt;/del&gt;do/while&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, y for, permiten ejecutar iteraciones, bucles o ciclos. En cada caso se ejecuta un bloque &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;instrucciones mientras &lt;/del&gt;la condición &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;que &lt;/del&gt;se evalúa &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;tome valor verdadero. Se resalta &lt;/del&gt;que &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;cualquiera de las 3 instrucciones cumple con el mismo objetivo que es &lt;/del&gt;el de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ejecutar una secuencia de pasos, más de una vez.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Para una mayor comprensión se muestra su representación en un diagrama de actividad.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Archivo:DiagramaWhile&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;JPG]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Esta estructura de control permite repetir o iterar el [Bloque de Instrucciones] mientras la condición sea verdadera o dicho de otra manera&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;estas iteraciones terminarán cuando la condición sea falsa y entonces &lt;/ins&gt;se &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;podrá ejecutar &lt;/ins&gt;la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;siguiente instrucción después del while&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Es válido señalar que en esta instrucción la condición &lt;/ins&gt;se &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;evalúa al inicio del ciclo por lo &lt;/ins&gt;que &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;si &lt;/ins&gt;la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;primera vez &lt;/ins&gt;que &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;se evalúa &lt;/ins&gt;la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;condición esta es falsa&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;el ciclo &lt;/ins&gt;no &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;llegará a realizarse&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;== La instrucción do/while ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;La estructura &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;control &lt;/ins&gt;do/while &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;es otra sentencia &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;iteración en la que &lt;/ins&gt;la condición se evalúa &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;por primera vez una vez &lt;/ins&gt;que &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;se haya ejecutado &lt;/ins&gt;el &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[Bloque &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Instrucciones] y tienen la siguiente sintaxis:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;== La instrucción while ==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Archivo&lt;/ins&gt;:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;InstruccionDoWhile.JPG]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;La instrucción while tiene la siguiente sintaxis&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Una de las características importantes que se pueden aprovechar de las computadoras &lt;/del&gt;es &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;precisamente su capacidad de repetir &lt;/del&gt;la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ejecución de secuencias de instrucciones a una gran velocidad y con alto grado de confiabilidad. Para estos fines, precisamente se definen en los lenguajes de programación las estructuras de control iterativas. El objetivo de estas estructuras es permitir &lt;/del&gt;la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;expresión &lt;/del&gt;de la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;repetición de una secuencia de instrucciones, a estas estructuras se les denomina ciclo, lazo o bucle.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Su semántica &lt;/ins&gt;es la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;misma que &lt;/ins&gt;la de la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;instrucción while y &lt;/ins&gt;su &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;representación &lt;/ins&gt;en &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;un diagrama &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;actividad &lt;/ins&gt;es la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;siguiente:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Una de las características importantes que se pueden aprovechar de las computadoras es precisamente &lt;/del&gt;su &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;capacidad de repetir la ejecución de secuencias de instrucciones a una gran velocidad y con alto grado de confiabilidad. Para estos fines, precisamente se definen &lt;/del&gt;en &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;los lenguajes de programación las estructuras de control iterativas. El objetivo &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;estas estructuras &lt;/del&gt;es &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;permitir la expresión de &lt;/del&gt;la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;repetición de una secuencia de instrucciones, a estas estructuras se les denomina ciclo, lazo o bucle.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;== La instrucción do/while ==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Archivo:DiagramaDoWhile&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;JPG]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Una de las características importantes que se pueden aprovechar de las computadoras es precisamente su capacidad de repetir la ejecución de secuencias de instrucciones a una gran velocidad y con alto grado de confiabilidad. Para estos fines, precisamente se definen en los lenguajes de programación las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una secuencia de instrucciones, a estas estructuras se les denomina ciclo, lazo o bucle&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;En esta estructura repetitiva el bloque de instrucciones siempre se ejecuta al menos una vez pues la condición se evalúa al final. Una vez realizada la evaluación si el resultado es true, se vuelve a ejecutar el [Bloque de Instrucciones], en caso contrario se ejecutan las instrucciones que sigan a continuación saliendo del ciclo.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;La funcionalidad de este método será la misma que en el ejemplo con while. La única diferencia es la forma en que se controla el bucle. En la práctica, verá que la instrucción while se utiliza más a menudo que la instrucción do – while. El elegir una instrucción en lugar de la otra es una elección personal.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Un aspecto muy importante a tener presente en los ciclos condicionales es la necesidad de contemplar dentro del bloque de instrucciones al menos una, que de alguna manera, altere –en algún momento- el resultado de la expresión booleana. La explicación sencillamente está dada por el hecho que de no existir esta instrucción una vez entrada al ciclo este nunca terminaría por lo que se caería en un ciclo infinito. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La estructura de control for == &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La estructura de control for == &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Una de las características importantes &lt;/del&gt;que se &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pueden aprovechar de &lt;/del&gt;las &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;computadoras es precisamente su capacidad &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;repetir la ejecución &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;secuencias &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;instrucciones a &lt;/del&gt;una &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;gran velocidad y &lt;/del&gt;con &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;alto grado &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;confiabilidad&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Para estos fines, precisamente se definen &lt;/del&gt;en los lenguajes de programación &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;las estructuras &lt;/del&gt;de control &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;iterativas&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;El objetivo &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;estas estructuras &lt;/del&gt;es &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;permitir &lt;/del&gt;la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;expresión &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;la repetición &lt;/del&gt;de una &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;secuencia de &lt;/del&gt;instrucciones&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, a estas estructuras &lt;/del&gt;se &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;les denomina ciclo&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;lazo o bucle&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Los procesos iterativos &lt;/ins&gt;que se &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;han visto hasta ahora terminan por una condición. En muchas situaciones &lt;/ins&gt;las &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;iteraciones se realizan un número determinado &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;veces, muchos autores les llaman ciclos por conteo pues se conoce &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;antemano cuántas veces se hará el proceso que se repite. En este tipo &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;iteración, siempre se necesita &lt;/ins&gt;una &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;variable que lleve el control de las veces que se repite el proceso por esto se les conoce también como ciclos &lt;/ins&gt;con &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;variable &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;control&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Una &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;las características importantes &lt;/del&gt;que &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;se pueden aprovechar &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;las computadoras es precisamente su capacidad &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;repetir &lt;/del&gt;la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ejecución de secuencias de &lt;/del&gt;instrucciones &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a una gran velocidad y con alto grado de confiabilidad&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Para estos fines, precisamente se definen &lt;/del&gt;en &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;los lenguajes &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;programación &lt;/del&gt;las &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;estructuras &lt;/del&gt;de control &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;iterativas&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;El objetivo &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;estas estructuras &lt;/del&gt;es &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;permitir &lt;/del&gt;la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;expresión &lt;/del&gt;de la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;repetición de &lt;/del&gt;una &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;secuencia &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;instrucciones&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a estas estructuras se les denomina &lt;/del&gt;ciclo, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;lazo o bucle&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Uno de los ciclos más conocidos y usados &lt;/ins&gt;en &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;la mayoría de &lt;/ins&gt;los &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/ins&gt;lenguajes de programación&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]] es el de la instrucción for que suele estar controlado por un contador o variable &lt;/ins&gt;de control &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;y tiene la siguiente sintaxis:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Archivo:InstruccionFor&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;JPG]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;La semántica &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;la instrucción &lt;/ins&gt;es la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;siguiente: &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &amp;lt;instrucciones 1&amp;gt;. Se ejecutará una sola vez al inicio del ciclo, generalmente se realizan inicializaciones y declaraciones de variables puesto que como se dijo con anterioridad, esta solo se ejecuta una vez. En caso &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;que se quiera realizar o ejecutar más &lt;/ins&gt;de una &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;instrucción en este momento, dichas &lt;/ins&gt;instrucciones se &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;deben separar por comas (“&lt;/ins&gt;,&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;”)&lt;/ins&gt;. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &amp;lt;expresión&amp;gt;. Es evaluada en cada iteración y en dependencia del valor que devuelva, dependerá que el ciclo continúe ejecutándose (valor &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;la expresión true) o no (false). Destacar &lt;/ins&gt;que de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;no colocarse nada en esta parte, el ciclo tomará como true el valor &lt;/ins&gt;de la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;expresión por lo que en principio, el ciclo puede estar repitiéndose infinitamente. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &amp;lt;&lt;/ins&gt;instrucciones &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;2&amp;gt;&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Es ejecutado siempre &lt;/ins&gt;en &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;cada ciclo al terminar &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ejecutar todas las instrucciones que pertenecen al bucle for en cuestión. Por lo general puede contener alguna actualización para &lt;/ins&gt;las &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;variables &lt;/ins&gt;de control. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Análogamente a &amp;lt;instrucciones 1&amp;gt; en caso &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;querer ejecutar en este momento más de una instrucción se deben separar por comas.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Observe que &lt;/ins&gt;es &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;obligatorio para separar cada término que compone &lt;/ins&gt;la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;instrucción for utilizar un punto y coma (;) de lo contrario el compilador mostrará un error &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;tipo semántico. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Reiterar que &lt;/ins&gt;la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;instrucción 1&amp;gt; se ejecuta &lt;/ins&gt;una &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sola vez al comienzo, que la &amp;lt;instrucción 2&amp;gt; es la que generalmente se utiliza para modificar la variable &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;control aunque en el ciclo esta puede modificarse también, y que &amp;lt;expresión&amp;gt;&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;es la que garantiza la finitud del &lt;/ins&gt;ciclo, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;el for se estará ejecutando siempre y cuando &amp;lt;expresión&amp;gt; sea evaluada y tome valor true&lt;/ins&gt;. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Caso de Estudio ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Caso de Estudio ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para mejor entendimiento de lo expuesto anteriormente, se presenta el siguiente caso de estudio en que se trabajará con cada una de las estructuras repetitivas.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para mejor entendimiento de lo expuesto anteriormente, se presenta el siguiente caso de estudio en que se trabajará con cada una de las estructuras repetitivas.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki1:diff::1.12:old-3580547:rev-3580705 --&gt;
&lt;/table&gt;</summary>
		<author><name>Carlos idict</name></author>
		
	</entry>
	<entry>
		<id>https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=3580547&amp;oldid=prev</id>
		<title>Javier martinez1867: /* La instrucción do/while */</title>
		<link rel="alternate" type="text/html" href="https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=3580547&amp;oldid=prev"/>
		<updated>2019-11-15T01:36:33Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;La instrucción do/while&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisión del 01:36 15 nov 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot; &gt;Línea 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La instrucción do/while ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La instrucción do/while ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;La estructura &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;control do/while &lt;/del&gt;es &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;otra sentencia &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;iteración &lt;/del&gt;en la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;que &lt;/del&gt;la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;condición se evalúa por primera vez &lt;/del&gt;una &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;vez que &lt;/del&gt;se &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;haya ejecutado el [Bloque de Instrucciones] y tienen la siguiente sintaxis:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Una &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;las características importantes que se pueden aprovechar de las computadoras &lt;/ins&gt;es &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;precisamente su capacidad &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;repetir la ejecución de secuencias de instrucciones a una gran velocidad y con alto grado de confiabilidad. Para estos fines, precisamente se definen &lt;/ins&gt;en &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;los lenguajes de programación las estructuras de control iterativas. El objetivo de estas estructuras es permitir &lt;/ins&gt;la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;expresión de &lt;/ins&gt;la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;repetición de &lt;/ins&gt;una &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;secuencia de instrucciones, a estas estructuras &lt;/ins&gt;se &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;les denomina ciclo, lazo o bucle.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Archivo:InstruccionDoWhile.JPG]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Su semántica es la misma que la de la instrucción while y su representación en un diagrama de actividad es la siguiente:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Archivo:DiagramaDoWhile.JPG]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;En esta estructura repetitiva el bloque de instrucciones siempre se ejecuta al menos una vez pues la condición se evalúa al final. Una vez realizada la evaluación si el resultado es true, se vuelve a ejecutar el [Bloque de Instrucciones], en caso contrario se ejecutan las instrucciones que sigan a continuación saliendo del ciclo.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;La funcionalidad de este método será la misma que en el ejemplo con while. La única diferencia es la forma en que se controla el bucle. En la práctica, verá que la instrucción while se utiliza más a menudo que la instrucción do – while. El elegir una instrucción en lugar de la otra es una elección personal.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Un aspecto muy importante a tener presente en los ciclos condicionales es la necesidad de contemplar dentro del bloque de instrucciones al menos una, que de alguna manera, altere –en algún momento- el resultado de la expresión booleana. La explicación sencillamente está dada por el hecho que de no existir esta instrucción una vez entrada al ciclo este nunca terminaría por lo que se caería en un ciclo infinito. &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La estructura de control for == &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La estructura de control for == &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Una de las características importantes que se pueden aprovechar de las computadoras es precisamente su capacidad de repetir la ejecución de secuencias de instrucciones a una gran velocidad y con alto grado de confiabilidad. Para estos fines, precisamente se definen en los lenguajes de programación las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una secuencia de instrucciones, a estas estructuras se les denomina ciclo, lazo o bucle.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Una de las características importantes que se pueden aprovechar de las computadoras es precisamente su capacidad de repetir la ejecución de secuencias de instrucciones a una gran velocidad y con alto grado de confiabilidad. Para estos fines, precisamente se definen en los lenguajes de programación las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una secuencia de instrucciones, a estas estructuras se les denomina ciclo, lazo o bucle.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki1:diff::1.12:old-3580546:rev-3580547 --&gt;
&lt;/table&gt;</summary>
		<author><name>Javier martinez1867</name></author>
		
	</entry>
	<entry>
		<id>https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=3580546&amp;oldid=prev</id>
		<title>Javier martinez1867: /* La instrucción while */</title>
		<link rel="alternate" type="text/html" href="https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=3580546&amp;oldid=prev"/>
		<updated>2019-11-15T01:34:53Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;La instrucción while&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisión del 01:34 15 nov 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l36&quot; &gt;Línea 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 36:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La instrucción while tiene la siguiente sintaxis:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La instrucción while tiene la siguiente sintaxis:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[Archivo:InstruccionWhile&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;JPG]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Una de las características importantes que se pueden aprovechar de las computadoras es precisamente su capacidad de repetir la ejecución de secuencias de instrucciones a una gran velocidad y con alto grado de confiabilidad. Para estos fines, precisamente se definen en los lenguajes de programación las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una secuencia de instrucciones, a estas estructuras se les denomina ciclo, lazo o bucle.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Una de las características importantes que se pueden aprovechar de las computadoras es precisamente su capacidad de repetir la ejecución de secuencias de instrucciones a una gran velocidad y con alto grado de confiabilidad. Para estos fines, precisamente se definen en los lenguajes de programación las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una secuencia de instrucciones, a estas estructuras se les denomina ciclo, lazo o bucle&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;La semántica de la instrucción es la siguiente:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;lt;condición&amp;gt;. Está representada por una expresión booleana y mientras se cumpla se ejecutará el ciclo.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [Bloque de Instrucciones] El bloque de instrucciones puede estar formado por una o varias instrucciones y es el conjunto de pasos que se van ejecutar en cada iteración del ciclo.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Para una mayor comprensión se muestra su representación en un diagrama de actividad.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Archivo:DiagramaWhile.JPG]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Esta estructura de control permite repetir o iterar el [Bloque de Instrucciones] mientras la condición sea verdadera o dicho de otra manera, estas iteraciones terminarán cuando la condición sea falsa y entonces se podrá ejecutar la siguiente instrucción después del while.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Es válido señalar que en esta instrucción la condición se evalúa al inicio del ciclo por lo que si la primera vez que se evalúa la condición esta es falsa, el ciclo no llegará a realizarse.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La instrucción do/while ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La instrucción do/while ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La estructura de control do/while es otra sentencia de iteración en la que la condición se evalúa por primera vez una vez que se haya ejecutado el [Bloque de Instrucciones] y tienen la siguiente sintaxis:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La estructura de control do/while es otra sentencia de iteración en la que la condición se evalúa por primera vez una vez que se haya ejecutado el [Bloque de Instrucciones] y tienen la siguiente sintaxis:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki1:diff::1.12:old-3580545:rev-3580546 --&gt;
&lt;/table&gt;</summary>
		<author><name>Javier martinez1867</name></author>
		
	</entry>
	<entry>
		<id>https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=3580545&amp;oldid=prev</id>
		<title>Javier martinez1867: /* La estructura de control for */</title>
		<link rel="alternate" type="text/html" href="https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=3580545&amp;oldid=prev"/>
		<updated>2019-11-15T01:33:37Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;La estructura de control for&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisión del 01:33 15 nov 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l62&quot; &gt;Línea 62:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 62:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Un aspecto muy importante a tener presente en los ciclos condicionales es la necesidad de contemplar dentro del bloque de instrucciones al menos una, que de alguna manera, altere –en algún momento- el resultado de la expresión booleana. La explicación sencillamente está dada por el hecho que de no existir esta instrucción una vez entrada al ciclo este nunca terminaría por lo que se caería en un ciclo infinito. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Un aspecto muy importante a tener presente en los ciclos condicionales es la necesidad de contemplar dentro del bloque de instrucciones al menos una, que de alguna manera, altere –en algún momento- el resultado de la expresión booleana. La explicación sencillamente está dada por el hecho que de no existir esta instrucción una vez entrada al ciclo este nunca terminaría por lo que se caería en un ciclo infinito. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La estructura de control for == &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La estructura de control for == &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Los procesos iterativos &lt;/del&gt;que se &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;han visto hasta ahora terminan por una condición. En muchas situaciones &lt;/del&gt;las &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;iteraciones se realizan un número determinado &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;veces, muchos autores les llaman ciclos por conteo pues se conoce &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;antemano cuántas veces se hará el proceso que se repite. En este tipo &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;iteración, siempre se necesita &lt;/del&gt;una &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;variable que lleve el control de las veces que se repite el proceso por esto se les conoce también como ciclos &lt;/del&gt;con &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;variable &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;control&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Una de las características importantes &lt;/ins&gt;que se &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pueden aprovechar de &lt;/ins&gt;las &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;computadoras es precisamente su capacidad &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;repetir la ejecución &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;secuencias &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;instrucciones a &lt;/ins&gt;una &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;gran velocidad y &lt;/ins&gt;con &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;alto grado &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;confiabilidad&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Para estos fines, precisamente se definen &lt;/ins&gt;en los lenguajes de programación &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;las estructuras &lt;/ins&gt;de control &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;iterativas&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;El objetivo &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;estas estructuras es permitir &lt;/ins&gt;la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;expresión de &lt;/ins&gt;la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;repetición de una secuencia de &lt;/ins&gt;instrucciones, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;a estas estructuras &lt;/ins&gt;se &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;les denomina ciclo&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;lazo o bucle&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Uno de los ciclos más conocidos y usados &lt;/del&gt;en &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;la mayoría de &lt;/del&gt;los &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/del&gt;lenguajes de programación&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]] es el de la instrucción for que suele estar controlado por un contador o variable &lt;/del&gt;de control &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;y tiene la siguiente sintaxis:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Una &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;las características importantes &lt;/ins&gt;que se &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pueden aprovechar &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;las computadoras es precisamente su capacidad &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;repetir &lt;/ins&gt;la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ejecución &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;secuencias &lt;/ins&gt;de instrucciones &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;a una gran velocidad y con alto grado de confiabilidad&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Para estos fines, precisamente se definen &lt;/ins&gt;en &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;los lenguajes &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;programación &lt;/ins&gt;las &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;estructuras &lt;/ins&gt;de control &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;iterativas&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;El objetivo &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;estas estructuras &lt;/ins&gt;es &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;permitir &lt;/ins&gt;la &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;expresión &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;la repetición &lt;/ins&gt;de una &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;secuencia de instrucciones&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;a estas estructuras &lt;/ins&gt;se &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;les denomina &lt;/ins&gt;ciclo, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;lazo o bucle&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[Archivo:InstruccionFor&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;JPG]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;La semántica &lt;/del&gt;de la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;instrucción es &lt;/del&gt;la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;siguiente: &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* &amp;lt;&lt;/del&gt;instrucciones &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1&amp;gt;. Se ejecutará una sola vez al inicio del ciclo&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;generalmente &lt;/del&gt;se &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;realizan inicializaciones y declaraciones de variables puesto que como se dijo con anterioridad&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;esta solo se ejecuta una vez&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;En caso &lt;/del&gt;de que se &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;quiera realizar o ejecutar más &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;una instrucción en este momento, dichas instrucciones se deben separar por comas (“,”). &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* &amp;lt;expresión&amp;gt;. Es evaluada en cada iteración y en dependencia del valor que devuelva, dependerá que el ciclo continúe ejecutándose (valor &lt;/del&gt;de la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;expresión true) o no (false). Destacar que &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;no colocarse nada en esta parte, el ciclo tomará como true el valor &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;la expresión por lo que en principio, el ciclo puede estar repitiéndose infinitamente. &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* &amp;lt;&lt;/del&gt;instrucciones &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;2&amp;gt;&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Es ejecutado siempre &lt;/del&gt;en &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;cada ciclo al terminar &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ejecutar todas las instrucciones que pertenecen al bucle for en cuestión. Por lo general puede contener alguna actualización para &lt;/del&gt;las &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;variables &lt;/del&gt;de control. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Análogamente a &amp;lt;instrucciones 1&amp;gt; en caso &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;querer ejecutar en este momento más de una instrucción se deben separar por comas.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Observe que &lt;/del&gt;es &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;obligatorio para separar cada término que compone &lt;/del&gt;la &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;instrucción for utilizar un punto y coma (;) &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;lo contrario el compilador mostrará un error &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;tipo semántico. &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Reiterar que la &amp;lt;instrucción 1&amp;gt; se ejecuta &lt;/del&gt;una &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;sola vez al comienzo&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;que la &amp;lt;instrucción 2&amp;gt; es la que generalmente &lt;/del&gt;se &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;utiliza para modificar la variable de control aunque en el &lt;/del&gt;ciclo &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;esta puede modificarse también&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;y que &amp;lt;expresión&amp;gt;, es la que garantiza la finitud del ciclo, el for se estará ejecutando siempre y cuando &amp;lt;expresión&amp;gt; sea evaluada y tome valor true&lt;/del&gt;. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Caso de Estudio ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Caso de Estudio ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para mejor entendimiento de lo expuesto anteriormente, se presenta el siguiente caso de estudio en que se trabajará con cada una de las estructuras repetitivas.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para mejor entendimiento de lo expuesto anteriormente, se presenta el siguiente caso de estudio en que se trabajará con cada una de las estructuras repetitivas.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki1:diff::1.12:old-3580544:rev-3580545 --&gt;
&lt;/table&gt;</summary>
		<author><name>Javier martinez1867</name></author>
		
	</entry>
	<entry>
		<id>https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=3580544&amp;oldid=prev</id>
		<title>Javier martinez1867: /* Estructuras de Control Iterativas */</title>
		<link rel="alternate" type="text/html" href="https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=3580544&amp;oldid=prev"/>
		<updated>2019-11-15T01:31:55Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Estructuras de Control Iterativas&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisión del 01:31 15 nov 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l25&quot; &gt;Línea 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Una de las características importantes que se pueden aprovechar de las [[computadora]]s es precisamente su capacidad de repetir la ejecución de [[secuencias de instrucciones]] a una gran velocidad y con alto grado de confiabilidad.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Una de las características importantes que se pueden aprovechar de las [[computadora]]s es precisamente su capacidad de repetir la ejecución de [[secuencias de instrucciones]] a una gran velocidad y con alto grado de confiabilidad.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para estos fines, precisamente se definen en los [[lenguajes de programación]] las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una [[secuencia de instrucciones]], a estas estructuras se les denomina ciclo, lazo o bucle. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para estos fines, precisamente se definen en los [[lenguajes de programación]] las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una [[secuencia de instrucciones]], a estas estructuras se les denomina ciclo, lazo o bucle. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Estructuras de Control Iterativas == &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==En la vida diaria existen situaciones que frecuentemente se resuelven realizando una determinada secuencia de pasos que puede repetirse muchas veces, ejemplo:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;En la vida diaria existen situaciones que frecuentemente se resuelven realizando una determinada secuencia de pasos que puede repetirse muchas veces, ejemplo: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/del&gt;El proceso que seguimos para comer, mientras no se termine la comida.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/del&gt;El proceso de insertar monedas, hasta que se abone la cantidad necesaria.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;El proceso que seguimos para comer, mientras no se termine la comida.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/del&gt;Las operaciones que realizamos para llamar por teléfono, mientras no se logre la comunicación. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;El proceso de insertar monedas, hasta que se abone la cantidad necesaria.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Como se puede observar estos son algoritmos que se hacen cotidianamente, pero tienen la particularidad de que la ejecución de alguno de sus pasos puede repetirse muchas veces, mientras no se logre la meta trazada. A este tipo de algoritmo se le conoce como algoritmos iterativos o repetitivos. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Las operaciones que realizamos para llamar por teléfono, mientras no se logre la comunicación.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;En &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/del&gt;C#&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]]&lt;/del&gt;, las instrucciones while, do/while, y for, permiten ejecutar iteraciones, bucles o ciclos. En cada caso se ejecuta un bloque de instrucciones mientras la condición que se evalúa tome valor verdadero. Se resalta que cualquiera de las 3 instrucciones cumple con el mismo objetivo que es el de ejecutar una secuencia de pasos, más de una vez.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Como se puede observar estos son algoritmos que se hacen cotidianamente, pero tienen la particularidad de que la ejecución de alguno de sus pasos puede repetirse muchas veces, mientras no se logre la meta trazada. A este tipo de algoritmo se le conoce como algoritmos iterativos o repetitivos. En C#, las instrucciones while, do/while, y for, permiten ejecutar iteraciones, bucles o ciclos. En cada caso se ejecuta un bloque de instrucciones mientras la condición que se evalúa tome valor verdadero. Se resalta que cualquiera de las 3 instrucciones cumple con el mismo objetivo que es el de ejecutar una secuencia de pasos, más de una vez.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La instrucción while ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== La instrucción while ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La instrucción while tiene la siguiente sintaxis:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La instrucción while tiene la siguiente sintaxis:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki1:diff::1.12:old-1423484:rev-3580544 --&gt;
&lt;/table&gt;</summary>
		<author><name>Javier martinez1867</name></author>
		
	</entry>
	<entry>
		<id>https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=1423484&amp;oldid=prev</id>
		<title>Lajas1 jc en 16:20 10 mar 2012</title>
		<link rel="alternate" type="text/html" href="https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=1423484&amp;oldid=prev"/>
		<updated>2012-03-10T16:20:03Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisión del 16:20 10 mar 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Línea 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Normalizar|motivo=}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Ficha Software&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Ficha Software&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|nombre= Estructuras de Control: Iteraciones &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|nombre= Estructuras de Control: Iteraciones &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|familia=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|familia=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|imagen= &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|imagen=&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Diagite.jpg&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|tamaño=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|tamaño=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|descripción= &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Qué son y cómo utilizar y declarar las iteraciones usando ejemplos &lt;/del&gt;de &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;C#&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|descripción= &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;La estructura&amp;#160; iterativa o &lt;/ins&gt;de &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;repetición permite ejecutar una o varias instrucciones,&amp;#160; un número determinado de veces o, indefinidamente, mientras se cumpla&amp;#160; una condición&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|imagen2=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|imagen2=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|tamaño2=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|tamaño2=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki1:diff::1.12:old-1345778:rev-1423484 --&gt;
&lt;/table&gt;</summary>
		<author><name>Lajas1 jc</name></author>
		
	</entry>
	<entry>
		<id>https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=1345778&amp;oldid=prev</id>
		<title>Mayte ciget.cfg en 03:36 30 ene 2012</title>
		<link rel="alternate" type="text/html" href="https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=1345778&amp;oldid=prev"/>
		<updated>2012-01-30T03:36:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisión del 03:36 30 ene 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l24&quot; &gt;Línea 24:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 24:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Una de las características importantes que se pueden aprovechar de las [[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;computadoras&lt;/del&gt;]] es precisamente su capacidad de repetir la ejecución de [[secuencias de instrucciones]] a una gran velocidad y con alto grado de confiabilidad.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Una de las características importantes que se pueden aprovechar de las [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;computadora&lt;/ins&gt;]]&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;s &lt;/ins&gt;es precisamente su capacidad de repetir la ejecución de [[secuencias de instrucciones]] a una gran velocidad y con alto grado de confiabilidad.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para estos fines, precisamente se definen en los [[lenguajes de programación]] las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una [[secuencia de instrucciones]], a estas estructuras se les denomina ciclo, lazo o bucle. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para estos fines, precisamente se definen en los [[lenguajes de programación]] las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una [[secuencia de instrucciones]], a estas estructuras se les denomina ciclo, lazo o bucle. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Estructuras de Control Iterativas == &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Estructuras de Control Iterativas == &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki1:diff::1.12:old-1233052:rev-1345778 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mayte ciget.cfg</name></author>
		
	</entry>
	<entry>
		<id>https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=1233052&amp;oldid=prev</id>
		<title>Humbertojccmg en 15:43 3 dic 2011</title>
		<link rel="alternate" type="text/html" href="https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=1233052&amp;oldid=prev"/>
		<updated>2011-12-03T15:43:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisión del 15:43 3 dic 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Línea 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Normalizar|motivo=}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Ficha Software&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Ficha Software&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|nombre= Estructuras de Control: Iteraciones &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|nombre= Estructuras de Control: Iteraciones &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki1:diff::1.12:old-1223470:rev-1233052 --&gt;
&lt;/table&gt;</summary>
		<author><name>Humbertojccmg</name></author>
		
	</entry>
	<entry>
		<id>https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=1223470&amp;oldid=prev</id>
		<title>Josealbertoad110110jcvcl: Página creada con '{{Ficha Software |nombre= Estructuras de Control: Iteraciones  |familia= |imagen=  |tamaño= |descripción= Qué son y cómo utilizar y declarar las iteraciones usando ejemplos ...'</title>
		<link rel="alternate" type="text/html" href="https://www.ecured.cu/index.php?title=Estructuras_de_Control:_Iteraciones&amp;diff=1223470&amp;oldid=prev"/>
		<updated>2011-12-01T14:14:17Z</updated>

		<summary type="html">&lt;p&gt;Página creada con &amp;#039;{{Ficha Software |nombre= Estructuras de Control: Iteraciones  |familia= |imagen=  |tamaño= |descripción= Qué son y cómo utilizar y declarar las iteraciones usando ejemplos ...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Ficha Software&lt;br /&gt;
|nombre= Estructuras de Control: Iteraciones &lt;br /&gt;
|familia=&lt;br /&gt;
|imagen= &lt;br /&gt;
|tamaño=&lt;br /&gt;
|descripción= Qué son y cómo utilizar y declarar las iteraciones usando ejemplos de C#.&lt;br /&gt;
|imagen2=&lt;br /&gt;
|tamaño2=&lt;br /&gt;
|descripción2=&lt;br /&gt;
|creador=&lt;br /&gt;
|desarrollador= [[Microsoft]] Corporation.&lt;br /&gt;
|diseñador=&lt;br /&gt;
|modelo de desarrollo= [[C#]]&lt;br /&gt;
|lanzamiento inicial= [[2003]]&lt;br /&gt;
|versiones=&lt;br /&gt;
|última versión estable=&lt;br /&gt;
|género=&lt;br /&gt;
|sistemas operativos= &lt;br /&gt;
|idioma=&lt;br /&gt;
|licencia= Comercial.&lt;br /&gt;
|premios=&lt;br /&gt;
|web= http://www.microsoft.com/net&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Una de las características importantes que se pueden aprovechar de las [[computadoras]] es precisamente su capacidad de repetir la ejecución de [[secuencias de instrucciones]] a una gran velocidad y con alto grado de confiabilidad.&lt;br /&gt;
Para estos fines, precisamente se definen en los [[lenguajes de programación]] las estructuras de control iterativas. El objetivo de estas estructuras es permitir la expresión de la repetición de una [[secuencia de instrucciones]], a estas estructuras se les denomina ciclo, lazo o bucle. &lt;br /&gt;
== Estructuras de Control Iterativas == &lt;br /&gt;
En la vida diaria existen situaciones que frecuentemente se resuelven realizando una determinada secuencia de pasos que puede repetirse muchas veces, ejemplo: &lt;br /&gt;
* El proceso que seguimos para comer, mientras no se termine la comida.&lt;br /&gt;
* El proceso de insertar monedas, hasta que se abone la cantidad necesaria.&lt;br /&gt;
* Las operaciones que realizamos para llamar por teléfono, mientras no se logre la comunicación. &lt;br /&gt;
Como se puede observar estos son algoritmos que se hacen cotidianamente, pero tienen la particularidad de que la ejecución de alguno de sus pasos puede repetirse muchas veces, mientras no se logre la meta trazada. A este tipo de algoritmo se le conoce como algoritmos iterativos o repetitivos. &lt;br /&gt;
En [[C#]], las instrucciones while, do/while, y for, permiten ejecutar iteraciones, bucles o ciclos. En cada caso se ejecuta un bloque de instrucciones mientras la condición que se evalúa tome valor verdadero. Se resalta que cualquiera de las 3 instrucciones cumple con el mismo objetivo que es el de ejecutar una secuencia de pasos, más de una vez.&lt;br /&gt;
== La instrucción while ==&lt;br /&gt;
La instrucción while tiene la siguiente sintaxis:&lt;br /&gt;
&lt;br /&gt;
[[Archivo:InstruccionWhile.JPG]]&lt;br /&gt;
&lt;br /&gt;
La semántica de la instrucción es la siguiente:&lt;br /&gt;
* &amp;lt;condición&amp;gt;. Está representada por una expresión booleana y mientras se cumpla se ejecutará el ciclo.&lt;br /&gt;
* [Bloque de Instrucciones] El bloque de instrucciones puede estar formado por una o varias instrucciones y es el conjunto de pasos que se van ejecutar en cada iteración del ciclo.&lt;br /&gt;
Para una mayor comprensión se muestra su representación en un diagrama de actividad.&lt;br /&gt;
 &lt;br /&gt;
[[Archivo:DiagramaWhile.JPG]]&lt;br /&gt;
 &lt;br /&gt;
Esta estructura de control permite repetir o iterar el [Bloque de Instrucciones] mientras la condición sea verdadera o dicho de otra manera, estas iteraciones terminarán cuando la condición sea falsa y entonces se podrá ejecutar la siguiente instrucción después del while.&lt;br /&gt;
 &lt;br /&gt;
Es válido señalar que en esta instrucción la condición se evalúa al inicio del ciclo por lo que si la primera vez que se evalúa la condición esta es falsa, el ciclo no llegará a realizarse.&lt;br /&gt;
 &lt;br /&gt;
== La instrucción do/while ==&lt;br /&gt;
La estructura de control do/while es otra sentencia de iteración en la que la condición se evalúa por primera vez una vez que se haya ejecutado el [Bloque de Instrucciones] y tienen la siguiente sintaxis:&lt;br /&gt;
&lt;br /&gt;
[[Archivo:InstruccionDoWhile.JPG]]&lt;br /&gt;
&lt;br /&gt;
Su semántica es la misma que la de la instrucción while y su representación en un diagrama de actividad es la siguiente:&lt;br /&gt;
&lt;br /&gt;
[[Archivo:DiagramaDoWhile.JPG]]&lt;br /&gt;
&lt;br /&gt;
En esta estructura repetitiva el bloque de instrucciones siempre se ejecuta al menos una vez pues la condición se evalúa al final. Una vez realizada la evaluación si el resultado es true, se vuelve a ejecutar el [Bloque de Instrucciones], en caso contrario se ejecutan las instrucciones que sigan a continuación saliendo del ciclo.&lt;br /&gt;
La funcionalidad de este método será la misma que en el ejemplo con while. La única diferencia es la forma en que se controla el bucle. En la práctica, verá que la instrucción while se utiliza más a menudo que la instrucción do – while. El elegir una instrucción en lugar de la otra es una elección personal.&lt;br /&gt;
Un aspecto muy importante a tener presente en los ciclos condicionales es la necesidad de contemplar dentro del bloque de instrucciones al menos una, que de alguna manera, altere –en algún momento- el resultado de la expresión booleana. La explicación sencillamente está dada por el hecho que de no existir esta instrucción una vez entrada al ciclo este nunca terminaría por lo que se caería en un ciclo infinito. &lt;br /&gt;
== La estructura de control for == &lt;br /&gt;
Los procesos iterativos que se han visto hasta ahora terminan por una condición. En muchas situaciones las iteraciones se realizan un número determinado de veces, muchos autores les llaman ciclos por conteo pues se conoce de antemano cuántas veces se hará el proceso que se repite. En este tipo de iteración, siempre se necesita una variable que lleve el control de las veces que se repite el proceso por esto se les conoce también como ciclos con variable de control.&lt;br /&gt;
Uno de los ciclos más conocidos y usados en la mayoría de los [[lenguajes de programación]] es el de la instrucción for que suele estar controlado por un contador o variable de control y tiene la siguiente sintaxis:&lt;br /&gt;
 &lt;br /&gt;
[[Archivo:InstruccionFor.JPG]]&lt;br /&gt;
 &lt;br /&gt;
La semántica de la instrucción es la siguiente: &lt;br /&gt;
* &amp;lt;instrucciones 1&amp;gt;. Se ejecutará una sola vez al inicio del ciclo, generalmente se realizan inicializaciones y declaraciones de variables puesto que como se dijo con anterioridad, esta solo se ejecuta una vez. En caso de que se quiera realizar o ejecutar más de una instrucción en este momento, dichas instrucciones se deben separar por comas (“,”). &lt;br /&gt;
* &amp;lt;expresión&amp;gt;. Es evaluada en cada iteración y en dependencia del valor que devuelva, dependerá que el ciclo continúe ejecutándose (valor de la expresión true) o no (false). Destacar que de no colocarse nada en esta parte, el ciclo tomará como true el valor de la expresión por lo que en principio, el ciclo puede estar repitiéndose infinitamente. &lt;br /&gt;
* &amp;lt;instrucciones 2&amp;gt;. Es ejecutado siempre en cada ciclo al terminar de ejecutar todas las instrucciones que pertenecen al bucle for en cuestión. Por lo general puede contener alguna actualización para las variables de control. Análogamente a &amp;lt;instrucciones 1&amp;gt; en caso de querer ejecutar en este momento más de una instrucción se deben separar por comas.&lt;br /&gt;
Observe que es obligatorio para separar cada término que compone la instrucción for utilizar un punto y coma (;) de lo contrario el compilador mostrará un error de tipo semántico. &lt;br /&gt;
Reiterar que la &amp;lt;instrucción 1&amp;gt; se ejecuta una sola vez al comienzo, que la &amp;lt;instrucción 2&amp;gt; es la que generalmente se utiliza para modificar la variable de control aunque en el ciclo esta puede modificarse también, y que &amp;lt;expresión&amp;gt;, es la que garantiza la finitud del ciclo, el for se estará ejecutando siempre y cuando &amp;lt;expresión&amp;gt; sea evaluada y tome valor true. &lt;br /&gt;
== Caso de Estudio ==&lt;br /&gt;
Para mejor entendimiento de lo expuesto anteriormente, se presenta el siguiente caso de estudio en que se trabajará con cada una de las estructuras repetitivas.&lt;br /&gt;
&lt;br /&gt;
[[Archivo:CasoEstudioIteraciones.JPG]]&lt;br /&gt;
 &lt;br /&gt;
=== MCD() ===&lt;br /&gt;
Para implementar la responsabilidad de la clase de calcular el Máximo Común Divisor MCD se utilizará el algoritmo de Euclides que consiste en: &lt;br /&gt;
* P1: Si los números son iguales, tomar el primer número como respuesta y concluir la ejecución del algoritmo, en otro caso pasar al paso 2.&lt;br /&gt;
* P2: Determinar cuál de los dos números es mayor.&lt;br /&gt;
* P3: Sustituir el número mayor por la diferencia entre los números mayor y menor.&lt;br /&gt;
* P4: Pasar al paso 1. &lt;br /&gt;
Obsérvese como se repiten los pasos 1,2 y 3 y el paso 4 consiste precisamente en regresar al paso 1, esta repetición se conoce normalmente con el nombre de iteración, nótese que esta no es infinita, precisamente en el primer paso se especifica que los pasos siguientes (2, 3, 4) han de ejecutarse si no cumple la condición de que los números sean iguales. Esta condición es una expresión booleana. &lt;br /&gt;
* Ejecutar el algoritmo para un par de valores (8 y 20 por ejemplo) &lt;br /&gt;
Para implementar el método que permita calcular el máximo común divisor utilizaremos la estructura de control while se evaluará la condición de que los números sean diferentes y en dependencia del resultado de la misma se ejecutarán o no los pasos que forman parte del ciclo.&lt;br /&gt;
El método MCD, quedaría de la siguiente manera: &lt;br /&gt;
 &lt;br /&gt;
[[Archivo:MCD.JPG]]&lt;br /&gt;
 &lt;br /&gt;
=== CantDigitos() === &lt;br /&gt;
Para determinar la cantidad de dígitos que tiene el número, primeramente se divide el número entre 10, si el cociente de la división es 0, se toma 1 como respuesta, sino, se toma dicho cociente y se divide entre 10, este proceso se estará repitiendo mientras el nuevo cociente sea distinto de 0. &lt;br /&gt;
Como se observa, al menos se necesita realizar una división, por lo que la estructura do/while es la indicada para implementar este algoritmo. &lt;br /&gt;
Para implementar el método hay que tener en cuenta lo siguiente:&lt;br /&gt;
* P1: Se realiza la división del número entre 10.&lt;br /&gt;
* P2: Se almacena el cociente en una variable y se cuenta que número de división es.&lt;br /&gt;
* P3: Si el resultado del cociente es distinto de 0, se repite el paso 1. &lt;br /&gt;
El método quedaría de la siguiente manera:&lt;br /&gt;
 &lt;br /&gt;
[[Archivo:CantDigitos.JPG]]&lt;br /&gt;
 &lt;br /&gt;
=== Factorial() ===&lt;br /&gt;
Para implementar la última responsabilidad propuesta, Calcular el Factorial, utilizaremos la estructura de control for, ya que se conoce de antemano la cantidad de operaciones (multiplicaciones) que hay que realizar. &lt;br /&gt;
Recuerde que el factorial de un número es el resultado de la multiplicación desde 1 hasta el número en cuestión. &lt;br /&gt;
* Ejemplo: Factorial de 5 es: 1 * 2 * 3 * 4 * 5 = 120 &lt;br /&gt;
El método quedaría de la siguiente manera.&lt;br /&gt;
&lt;br /&gt;
[[Archivo:Factorial.JPG]]&lt;br /&gt;
&lt;br /&gt;
== Ciclos Anidados ==&lt;br /&gt;
En muchos casos de la vida diaria no basta con repetir un grupo de instrucciones una cantidad de veces sino que esas repeticiones deben ser realizadas al mismo tiempo un número de ocasiones. Este tipo de problemas da origen a los algoritmos con ciclos compuestos o ciclos anidados. &lt;br /&gt;
Los ciclos anidados o compuestos no son más que ciclos que tienen otros ciclos dentro del bloque de instrucciones que deben ejecutar. Esta facilidad de componer uno o más ciclos en combinación con algunas estructuras de almacenamiento resulta muy útil para la solución de algunos algoritmos de búsqueda y ordenación que se verán más adelante en el curso. &lt;br /&gt;
Usualmente los ciclos que se componen para resolver un algoritmo en particular son los ciclos por variable de control, lo que no quiere decir que no se pueda hacer con ciclos con condición o con una combinación de ellos dos, lo que resultan menos frecuentes estos casos.&lt;br /&gt;
== Fuentes ==&lt;br /&gt;
* Grady Boosh. Análisis y Diseño Orientado a Objetos con Aplicaciones &lt;br /&gt;
* Bertran Meyer. Touch of Class &lt;br /&gt;
* M. Katrib, E. Quesada; Programación con Pascal, Pueblo y Educación, 1991. &lt;br /&gt;
* Colectivo de autores. Programación Orientada a Objetos con C#&lt;br /&gt;
[[Category:Programación]][[Category:Informática]]&lt;br /&gt;
[[Category:Lenguajes_de_programación_orientada_a_objetos]]&lt;/div&gt;</summary>
		<author><name>Josealbertoad110110jcvcl</name></author>
		
	</entry>
</feed>