<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-808900982761658146</id><updated>2024-09-01T07:04:10.441-07:00</updated><title type='text'>Curso C#</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://limocursocsharp.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/808900982761658146/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://limocursocsharp.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16191138664489270053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-808900982761658146.post-3990958795996461718</id><published>2011-12-30T15:20:00.000-08:00</published><updated>2011-12-30T15:41:05.078-08:00</updated><title type='text'>Estructuras de control</title><content type='html'>Las &lt;a href=&quot;http://es.wikipedia.org/wiki/Estructuras_de_control&quot; target=&quot;_blank&quot;&gt;estructuras de control&lt;/a&gt; nos permiten modificar el flujo de ejecución de las instrucciones de un programa.&lt;br /&gt;
&lt;br /&gt;
En C# estas &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/xt4z8b0f(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;estructuras&lt;/a&gt; son básicamente las mismas que encuentras en C/C++.&lt;br /&gt;
&lt;br /&gt;
En cuanto a las estructuras de &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/676s4xab(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;selección&lt;/a&gt;&amp;nbsp;son exactamente las mismas que las que conoces. A excepción de la estructura &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/06tc147t(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;switch&lt;/a&gt; que tiene una restricción adicional: &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;A jump statement such as a&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&lt;strong&gt;break&lt;/strong&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;is required after each&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&lt;strong&gt;case&lt;/strong&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;block, including the last block whether it is a&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&lt;strong&gt;case&lt;/strong&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;statement or a&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&lt;strong&gt;default&lt;/strong&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;statement.&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Las estructuras de &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/32dbftby(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;iteración&lt;/a&gt; son todas iguales excepto &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ttw7t8t6(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;foreach&lt;/a&gt; que es nueva. Esta estructura la veremos junto con las colecciones.&lt;br /&gt;
&lt;br /&gt;
Las estructuras de &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/d96yfwee(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;salto&lt;/a&gt; tienen algunas que tal vez no conozcas, como &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/9k7k7cf0(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;yield&lt;/a&gt;, y &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/1ah5wsex(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;throw&lt;/a&gt;&amp;nbsp;las cuales también veremos más adelante.&lt;br /&gt;
&lt;br /&gt;
Para empezar nos bastará con saber usar &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/5011f09h(v=VS.100).aspx&quot; target=&quot;_blank&quot;&gt;if&lt;/a&gt;, &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ch45axte(v=VS.100).aspx&quot; target=&quot;_blank&quot;&gt;for&lt;/a&gt;, &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/2aeyhxcd(v=VS.100).aspx&quot; target=&quot;_blank&quot;&gt;while&lt;/a&gt; y &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/06tc147t(v=VS.100).aspx&quot; target=&quot;_blank&quot;&gt;switch&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
La instrucción &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;if&lt;/span&gt; se compone de:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;if(&amp;lt;condición&amp;gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; instrucciones...&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;[else&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;instrucciones...&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
La condición debe ser un resultado booleano, esto es, que su valor sea &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;true&lt;/span&gt; o &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;false&lt;/span&gt; (a diferencia de C/C++ donde la condición puede ser un entero donde 0 es falso y cualquier otra cosa es verdadero).&lt;br /&gt;
La parte del else es opcional y las llaves {} de los bloques también son opcionales cuando el bloque se compone de una sola instrucción pero es recomendado como buena práctica siempre usarlos.&lt;br /&gt;
&lt;br /&gt;
La instrucción &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;for&lt;/span&gt; se compone de:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;for([inicialización]; [condición de paro]; [aumento])&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;instrucciones...&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Todas las partes son opcionales. Si no asignas una condición de paro, el &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;for&lt;/span&gt; será un ciclo infinito (que se puede romper con una sentencia de salto como &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/adbctzc4(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;break&lt;/a&gt;). Al igual que en el &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;if&lt;/span&gt;, el bloque delimitado por las llaves {} es opcional si es solo una instrucción, pero es mejor siempre usarlo.&lt;br /&gt;
El formato más común de for es el clásico:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;for(int i=0; i&amp;lt;5; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
La instrucción &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;while&lt;/span&gt; tiene la forma:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;while(&amp;lt;condición de continuación&amp;gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Al igual que en el &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;if&lt;/span&gt;, el bloque delimitado por las llaves {} es opcional si es solo una instrucción, pero es mejor siempre usarlo; y la condición debe ser obligatoriamente un booleano.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Ejercicios&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora a usar lo aprendido hasta ahorita:&lt;br /&gt;
&lt;br /&gt;
1.- Hacer un programa que lea de consola dos enteros separados por un espacio y escriba de regreso el menor de ellos.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://img.skitch.com/20111230-errfurjxuarkqe13hpau1k8y9p.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;586&quot; src=&quot;https://img.skitch.com/20111230-errfurjxuarkqe13hpau1k8y9p.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
A diferencia de la función scanf de C/C++, &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Console.ReadLine&lt;/span&gt; siempre lee cadenas de caracteres (&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;string&lt;/span&gt;) por lo que la entrada deberá ser convertida a entero. Esto puede ser hecho con el método &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Parse&lt;/span&gt; de &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Int32&lt;/span&gt; (también se puede escribir como &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;int.Parse(datos[0]);&lt;/span&gt; pero yo prefiero usar la clase &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Int32&lt;/span&gt;).&lt;br /&gt;
&lt;br /&gt;
Cada tipo de datos básico tiene su función &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Parse&lt;/span&gt; que convierte de una cadena a el tipo especificado, por ejemplo, puedes convertir a un booleano con &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Boolean.Parse(&quot;True&quot;)&lt;/span&gt;, o a un double con &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Double.Parse(&quot;3.1416&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
En los comentarios en la imagen, dice que la comparación también se puede hacer usando el operador ternario &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ty67wk28.aspx&quot; target=&quot;_blank&quot;&gt;?:&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
2.- Escribir un programa que imprima las tablas de multiplicar (del 2 al 10)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://img.skitch.com/20111230-1we9g5yc53mf4xdrgc89qubar4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;473&quot; src=&quot;https://img.skitch.com/20111230-1we9g5yc53mf4xdrgc89qubar4.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
En este código de ejemplo puedes ver que el método &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;WriteLine&lt;/span&gt; acepta una cadena de formato. Esto es, escribes la cadena con ciertos contenedores donde se escribirá el valor de una variable. Estos contenedores se delimitan entre llaves {} y contienen la posición de la variable (empezando en 0) que irá en ese lugar. Las variables que se declaran después de la cadena, separadas por comas. En este caso la variable 0 es &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;i&lt;/span&gt;, la 1 es &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;j&lt;/span&gt; y la 2 es &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;i*j&lt;/span&gt;. El orden en que escribas los contenedores en la cadena de formato no importa, por ejemplo, podríamos haber escrito:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Console.WriteLine(&quot;{2} = {0} x {1}&quot;, i, j, i * j);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Existen varios modificadores que se pueden usar en la cadena de formato. Los puedes revisar &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/828t9b9h.aspx&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Tareas:&lt;br /&gt;
&lt;br /&gt;
1.- Escribe un programa que lea de consola 5 números separados por un espacio y los escriba en orden en otra linea.&lt;br /&gt;
&lt;br /&gt;
2.- &lt;a href=&quot;http://en.wikipedia.org/wiki/Bizz_buzz&quot; target=&quot;_blank&quot;&gt;BizzBuzz&lt;/a&gt;&lt;br /&gt;
Escribe una aplicación que escriba el resultado de jugar BizzBuzz hasta el número 1000.&lt;br /&gt;
&lt;br /&gt;
3.- Escribe un programa que escriba &quot;par&quot; si el segundo actual es par e &quot;impar&quot; si el segundo actual es impar. (para conocer el segundo actual puedes usar &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;int actual = DateTime.Now.Second;&lt;/span&gt;)&lt;br /&gt;
&lt;br /&gt;
4.- Escribe una aplicación que lea un entero &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;n&amp;nbsp;&lt;/span&gt;de la consola y escriba un triángulo de *&#39;s con una base de tamaño &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;n&lt;/span&gt; (como se muestra en la figura).&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://img.skitch.com/20111230-p53da3cgcsf6qjd3r2tdjm8umt.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;316&quot; src=&quot;https://img.skitch.com/20111230-p53da3cgcsf6qjd3r2tdjm8umt.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Puedes escribir cadenas en la misma linea usando el método &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/hebffx2d.aspx&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Console.Write&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
5.- Escribe un programa que escriba en consola la suma de la hora mas el minuto mas el segundo actuales hasta que esta suma sea un múltiplo de 13.</content><link rel='replies' type='application/atom+xml' href='http://limocursocsharp.blogspot.com/feeds/3990958795996461718/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://limocursocsharp.blogspot.com/2011/12/estructuras-de-control.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/808900982761658146/posts/default/3990958795996461718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/808900982761658146/posts/default/3990958795996461718'/><link rel='alternate' type='text/html' href='http://limocursocsharp.blogspot.com/2011/12/estructuras-de-control.html' title='Estructuras de control'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16191138664489270053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-808900982761658146.post-5033951631053726000</id><published>2011-12-29T12:46:00.000-08:00</published><updated>2011-12-29T16:02:25.738-08:00</updated><title type='text'>Primeros pasos</title><content type='html'>Las variables en C# se declaran basicamente igual que en C/C++:&lt;br /&gt;
&lt;div&gt;
&lt;i&gt;tipo nombre [, nombres] [= inicialización]&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
C# es un lenguaje de tipos estáticos y sus tipos los puedes consultar en la siguiente &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ya5y69ds.aspx&quot; target=&quot;_blank&quot;&gt;tabla&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Algunos ejemplos de como declarar variables:&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;int i;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;long a, b;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;string nombre = &quot;Limo Wan Kenobi&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Existe una estructura que aunque no es un tipo de C# es muy usada: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.datetime.aspx&quot; target=&quot;_blank&quot;&gt;DateTime&lt;/a&gt;, que como su nombre lo indica, nos sirve para manejar fechas y horas.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Esta estructura tiene una propiedad que nos da la fecha y hora actuales: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.datetime.now.aspx&quot; target=&quot;_blank&quot;&gt;DateTime.Now&lt;/a&gt; y algunos constructores interesantes, por ejemplo el que construye una &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/272ba130.aspx&quot; target=&quot;_blank&quot;&gt;nueva fecha recibiendo como parámetros varios enteros indicando el año, mes, día, hora, minuto y segundo&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;DateTime actual = DateTime.Now;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;DateTime fecha = new DateTime(2011, 05, 05, 11, 45, 00);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para el caso de las cadenas (&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/362314fe(v=VS.100).aspx&quot; target=&quot;_blank&quot;&gt;string literals&lt;/a&gt;), existe un tipo especial que son las que se declaran con una @ antes de la cadena:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;string path = @&quot;c:\folder1\folder2\file.txt&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
En una cadena normal (i.e: &quot;cadena&quot;) el carácter &#39;&lt;b&gt;\&lt;/b&gt;&#39; se llama carácter de escape y sirve para declarar que se usará un carácter especial. Los más comunes son:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
\n .- Salto de linea&lt;/div&gt;
&lt;div&gt;
\&quot; .- Comillas dentro de la cadena (&quot;)&lt;/div&gt;
&lt;div&gt;
\\ .- diagonal invertida (backslash \)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
En el caso de las cadenas que llevan el prefijo @, el carácter &#39;\&#39; no funciona como carácter de escape sino como lo que es, una diagonal invertida.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Puedes revisar este link con varias cosas especiales de los &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms228362(v=VS.90).aspx&quot; target=&quot;_blank&quot;&gt;strings&lt;/a&gt;. Un método muy comúnmente usado en los string es &quot;Split&quot; el cual sirve para separar una cadena en varias tomando un (o unos) carácter(es) como separadores (el mas común el espacio &#39; &#39;).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;string input = &quot;1 2 3 hola adiós&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;string[] separado = input.Split(&#39; &#39;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Resultará en 5 cadenas: &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;hola&quot;, &quot;adiós&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Los &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/6a71f45d(v=VS.100).aspx&quot; target=&quot;_blank&quot;&gt;operadores&lt;/a&gt; en C# son también bastante comunes y parecidos a los de C/C++. aunque hay algunos especiales que iremos viendo poco a poco.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://limocursocsharp.blogspot.com/feeds/5033951631053726000/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://limocursocsharp.blogspot.com/2011/12/primeros-pasos.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/808900982761658146/posts/default/5033951631053726000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/808900982761658146/posts/default/5033951631053726000'/><link rel='alternate' type='text/html' href='http://limocursocsharp.blogspot.com/2011/12/primeros-pasos.html' title='Primeros pasos'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16191138664489270053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-808900982761658146.post-8073369705807573705</id><published>2011-12-28T18:58:00.000-08:00</published><updated>2011-12-28T18:58:36.066-08:00</updated><title type='text'>Hola Mundo</title><content type='html'>Para variar, lo primero que haremos será un &quot;Hola Mundo&quot; para aprender a crear proyectos en Visual Studio y compilar y esas cosas.&lt;br /&gt;
&lt;br /&gt;
Primero abrir Visual Studio y en la primer pantalla, dar click en Crear Nuevo Proyecto:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://img.skitch.com/20111229-eji7fg81s81x8cyspws3ds1t61.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://img.skitch.com/20111229-eji7fg81s81x8cyspws3ds1t61.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Y aparecerá un Wizard con muchas opciones.&lt;br /&gt;
Empezaremos creando aplicaciones de Consola:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://img.skitch.com/20111229-pwtgnhc7989gp9dws5tsc9rpnq.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;380&quot; src=&quot;https://img.skitch.com/20111229-pwtgnhc7989gp9dws5tsc9rpnq.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Al dar Ok, generará un nuevo proyecto de Consola. (La consola es una pantalla negra de solo texto. Es el tipo más sencillo de aplicación que se puede ejecutar).&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://img.skitch.com/20111229-txh5ajtb5fjyk44fjay1edrfd2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;306&quot; src=&quot;https://img.skitch.com/20111229-txh5ajtb5fjyk44fjay1edrfd2.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Al generar el proyecto, deberás ver una pestaña con el código y otra pestaña con el Explorador de Soluciones:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Una Solución es un contenedor de proyectos. Esto es, puede haber muchos proyectos en una misma solución. Un proyecto es un contenedor de archivos de código que se compila en un&amp;nbsp;&lt;a href=&quot;http://www.codeguru.com/columns/csharp_learning/article.php/c5845&quot; target=&quot;_blank&quot;&gt;Assembly&lt;/a&gt;&amp;nbsp;o Ensamblado (en español).&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Recomiendo leer el link acerca de los ensamblados para saber de que estamos hablando, pero en resumen, una aplicación está compuesta por uno o más Ensamblados; algunos son Librerías Dinámicas (DLL&#39;s) y otros son ejecutables (.Exe). Cada ensamblado contiene el resultado de compilar el código que escribiste.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
A diferencia de compilar en C/C++, en C# (en .Net en general), la compilación no genera código máquina sino que genera código en Intermediate Language (IL), esta diferencia no es importante en este momento.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
La sintaxis de C# está basada en la de C/C++ por lo que verás que el código se ve muy parecido.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Dentro del código autogenerado por Visual Studio vemos varias partes:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Varias líneas que comienzan con &lt;i&gt;&lt;b&gt;&lt;a href=&quot;http://geeks.ms/blogs/jmaguilar/archive/2009/03/04/usando-using-valga-la-redundancia-c.aspx&quot; target=&quot;_blank&quot;&gt;using&lt;/a&gt;&lt;/b&gt;&lt;/i&gt;. Esta sección la revisaremos mas adelante. Deberemos obviarla de momento. Basta decir que cada sentencia using está seguida de un &lt;i&gt;&lt;b&gt;namespace&lt;/b&gt;&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Una línea que comienza con &lt;i style=&quot;font-weight: bold;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/es-es/library/z2kcy19k(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;namespace&lt;/a&gt;&lt;/i&gt;. Esta linea indica en que &quot;Espacio de nombres&quot; nos encontramos (Ver link).&lt;/li&gt;
&lt;li&gt;Las llaves (parentesis curvos) { } indican bloques de código.&amp;nbsp;&lt;a href=&quot;http://www.decloak.com/Dev/CurlyBraceCorner/Default.aspx&quot; target=&quot;_blank&quot;&gt;¿Cómo leer los bloques?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Dentro del bloque del namespace se encuentra una declaración de una clase con la sentencia &lt;i&gt;&lt;b&gt;&lt;a href=&quot;http://msdn.microsoft.com/es-es/library/0b0thckt(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;class&lt;/a&gt;&lt;/b&gt;&lt;/i&gt;. Las clases son un concepto básico de la programación en C# por lo que lo estaremos viendo todo el tiempo. En este momento basta saber que todo el código que escribiremos pertenece a la clase &lt;i&gt;Program&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Dentro del bloque de código que corresponde a la clase Program, encontramos un &lt;i&gt;&lt;b&gt;método&lt;/b&gt;&lt;/i&gt; llamado &lt;i&gt;Main. &lt;/i&gt;Este método empieza con el &lt;i&gt;modificador&lt;/i&gt; &lt;b&gt;static&lt;/b&gt;, es de tipo &quot;vacío&quot; (&lt;b&gt;void&lt;/b&gt;) y recibe un parámetro llamado &lt;i&gt;args&lt;/i&gt;. Todo esto lo puedes obviar en este momento. Lo importante en este momento es que toda aplicación de consola necesita de un &quot;método de entrada&quot; o de inicio llamado Main. Este es el método que se ejecutará en cuanto la aplicación inicie.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Todo el código que estaremos escribiendo en esta primera parte irá dentro del bloque del método Main.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
El código generado por Visual Studio es un programa completo. Que no hace nada. Pero a final de cuentas es un programa. Para ejecutarlo buscas el Menú Debug-&amp;gt;Start Debugging (La tecla rápida es F5 en general).&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Verás como se abre una nueva ventana con fondo negro y como desaparece inmediatamente. Esa fue una aplicación de consola que se inició, se ejecutó y se cerró (sin hacer absolutamente nada).&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
El primer objeto que aprenderemos a usar será &lt;i style=&quot;font-weight: bold;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/es-es/library/system.console(v=vs.80).aspx&quot; target=&quot;_blank&quot;&gt;Console&lt;/a&gt;.&lt;/i&gt;&amp;nbsp;De este objeto nos van a interesar (en este momento) dos métodos: &lt;b&gt;&lt;i&gt;WriteLine&lt;/i&gt;&lt;/b&gt; y &lt;b&gt;&lt;i&gt;ReadLine&lt;/i&gt;&lt;/b&gt; que como su nombre lo indica, sirven para escribir una línea y para leer una línea respectivamente. Son los equivalentes a printf y scanf de C++.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Dentro del bloque del método Main, escribe las siguientes instrucciones:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Console.WriteLine(&quot;Hola Mundo&quot;);&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Console.ReadLine();&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://img.skitch.com/20111229-dqe59jfqckdwr1kdysd3unicpm.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;168&quot; src=&quot;https://img.skitch.com/20111229-dqe59jfqckdwr1kdysd3unicpm.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Las cadenas de texto en C# se escriben entre comillas &quot; &quot;, el método WriteLine escribe la cadena de texto tal cual la colocas.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Las llamadas a métodos en C# (al igual que en C/C++) terminan con &lt;a href=&quot;http://csharp-slackers.blogspot.com/2008/08/semicolons-positioning-and-indentation.html&quot; target=&quot;_blank&quot;&gt;punto y coma ;&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Si ejecutas la aplicación (F5) deberás ver algo así:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://img.skitch.com/20111229-bt4jdydb84hajitjjuw4kib36x.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;323&quot; src=&quot;https://img.skitch.com/20111229-bt4jdydb84hajitjjuw4kib36x.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Y esta vez la ventana de la consola no se cerrará. Esto es debido a la instrucción Console.ReadLine(); que esta esperando a leer lo que el usuario escriba. Para que la ejecución continúe, deberás presionar Enter (en cuyo caso, la ejecución continuará y la aplicación se cerrará).&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.homeandlearn.co.uk/csharp/csharp.html&quot; target=&quot;_blank&quot;&gt;http://www.homeandlearn.co.uk/csharp/csharp.html&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://limocursocsharp.blogspot.com/feeds/8073369705807573705/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://limocursocsharp.blogspot.com/2011/12/hola-mundo.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/808900982761658146/posts/default/8073369705807573705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/808900982761658146/posts/default/8073369705807573705'/><link rel='alternate' type='text/html' href='http://limocursocsharp.blogspot.com/2011/12/hola-mundo.html' title='Hola Mundo'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16191138664489270053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-808900982761658146.post-705505217519537062</id><published>2011-12-28T17:05:00.000-08:00</published><updated>2011-12-28T17:05:59.839-08:00</updated><title type='text'>Inicio</title><content type='html'>En este blog iré escribiendo un mini cursito de C# para Ale y chance para el Mario. Y cualquier otra persona que le interese.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Como Ale ya conoce un poco de C/C++ asumiré muchas veces que el lector ya tiene idea de que es programar y como se hace.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Además, estoy asumiendo que ya se tiene Visual Studio 2010 instalado.&lt;/div&gt;
&lt;div&gt;
Si no lo tienen, se puede descargar una versión gratuita:&amp;nbsp;&lt;a href=&quot;http://www.microsoft.com/express&quot;&gt;Express Edition&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://limocursocsharp.blogspot.com/feeds/705505217519537062/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://limocursocsharp.blogspot.com/2011/12/inicio.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/808900982761658146/posts/default/705505217519537062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/808900982761658146/posts/default/705505217519537062'/><link rel='alternate' type='text/html' href='http://limocursocsharp.blogspot.com/2011/12/inicio.html' title='Inicio'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16191138664489270053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>