Está en la página 1de 4

1. QUE MUESTRE LOS NUMEROS DESCENDENTES DEL 1 AL 100 DE DOS EN DOS.

using System;
{
class Program
{
static void Main(string[] args)
{
int numero;
Console.Write("Digite el valor del numero: ");
numero = Convert.ToInt32(Console.ReadLine());
do
{
if (numero % 2 == 0)
Console.WriteLine(numero);
}
numero--;
while (numero > 0) ;
Console.ReadKey();

}
}
}
2. QUE PIDA UN NUMERO Y MUESTRE LA TABLA DEL 1 AL 12 DE DICHO
NUMERO.

{
class Program
{
static void Main(string[] args)
{
int i, tabla1, tabla2;

Console.Write("Introduzca la tabla 1: ");


tabla1 = Convert.ToInt32(Console.ReadLine());
Console.Write("Introduzca la tabla 2: ");
tabla2 = Convert.ToInt32(Console.ReadLine());
for (i =1; i<=10; i++)
{
Console.WriteLine("{0}*{1}={2}", tabla1 i, tabla1 * i);
Console.WriteLine("{0}*{1}={2}", tabla2 i, tabla2 * i);
Console.ReadLine();
Console.ReadKey();

}
}
}
3. QUE PREGUNTE LA CANTIDAD DE MONTOS, PIDA DICHOS MONTOS Y
CALCULE LA SUMATORIA Y EL PROMEDIO.
{
class Program
{
static void Main(string[] args)
{
int monto, cantidad, promedio;

Console.Write("Ingrese la cantidad: ");


cantidad = Int32.Parse(Console.ReadLine());
Console.Write("Ingrese el monto: ");
monto = Int32.Parse(Console.ReadLine);

cantida + monto = promedio;


promedio = cantidad + monto * 100;

Console.Writeline("El resultado es: ", cantidad + monto / promedio);


Console.ReadLine();
Console.ReadKey();

}
}
}
4. QUE PIDA UN NOMBRE Y SE REPITA MIENTRAS NO SEA "JOSE" O LA
CANTIDAD DE NOMBRE INGRESADO SEA MENOR QUE 7.
{
class Program
{
static void Main(string[] args)
{
string Jose;
while (Jose <= 7)
{
Console.Write("Ingrese nombre: ");
Jose = string.Empty(Console.ReadLine());
}
Console.ReadKey();
}
}
}

También podría gustarte