



Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!




Ejercicio #1 casa using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Valdiviezo_Angel_Ejercicio { class Program { static void Main(string[] args) { Console.Title = "Casa"; for (int X1 = 10; X1 <= 50; X1++) { Console.SetCursorPosition(X1, 1); System.Threading.Thread.Sleep(50); Console.Write("-"); } for (int X2 = 1; X2 <= 5; X2++) { System.Threading.Thread.Sleep(50); Console.SetCursorPosition(50, X2); Console.Write("-");
for (int X3 = 50; X3 >= 10; X3--) { System.Threading.Thread.Sleep(50); Console.SetCursorPosition(X3, 5); Console.Write("-"); } for (int X4 = 5; X4 >= 1; X4--) { System.Threading.Thread.Sleep(50); Console.SetCursorPosition(10, X4); Console.Write("-"); } for (int X5 = 5; X5 <= 15; X5++) { Console.SetCursorPosition(45, X5); System.Threading.Thread.Sleep(50); Console.Write("-"); } for (int X6 = 45; X6 >= 15; X6--) { Console.SetCursorPosition(X6, 15); System.Threading.Thread.Sleep(50); Console.Write("-"); } for (int X7 = 15; X7 >= 5; X7--)
Ejercicio 2 Tabla de multiplicar using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp { class Program { static void Main(string[] args) { string OTRO; do { int X1; int X2; int X4; int X3; Console.Clear(); Console.Write("Numero de tabla............. : "); X1 = int.Parse(Console.ReadLine()); System.Threading.Thread.Sleep(100);
Console.Write("Numero inicial de la tabla...: "); X2 = int.Parse(Console.ReadLine()); System.Threading.Thread.Sleep(100); Console.Write("Numero final de la tabla.....: "); X3 = int.Parse(Console.ReadLine()); System.Threading.Thread.Sleep(100); Console.WriteLine(); Console.WriteLine(); for (X4 = X2; X4 <= X3; X4++) { Console.ForegroundColor = ConsoleColor.DarkBlue; Console.WriteLine(X1 + " x " + X4 + " = " + X4 * X1); System.Threading.Thread.Sleep(100); } Console.WriteLine(); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("Desea realizar otra operacion (S/N)..."); OTRO = Console.ReadLine().ToUpper(); } while (OTRO == "S"); }