domingo, 8 de noviembre de 2009

Practica # 8.2(a ,b y c)

PSEUDOCODIGO
int[] emax = new int[10];
int I, mayor;
PRINT("Introduce un munero entero");
READ emax[0]
mayor = emax[0];
for (I = 1; I <>
{PRINT("Introduce dato{0}", I);
READ emax[I]
if (emax[I] > mayor)
{
mayor = emax[I];
}
}
PRINT("Lista de 10 numeros enteros");
for (I = 0; I <>
{
PRINT(emax[I]);
}
PRINT("el valor maximo es {0}: ", mayor);

FIN
CODIGOS EN CONSOLA (A)



int[] emax = new int[10];
int I, mayor;
Console.WriteLine("Introduce un munero entero");
emax[0] = int.Parse(Console.ReadLine());
mayor = emax[0];
for (I = 1; I <> mayor)
{
mayor = emax[I];
}
}

Console.WriteLine("Lista de 10 numeros enteros");
for (I = 0; I <>
CODIGOS EN WINDOWS (A)

public partial class Form1 : Form
{
int[] Emax = new int[10];
int I, mayor, pos = 0;
public Form1()
{
InitializeComponent();
I = 0;
listBox1.Items.Add("Valores enteros:");
}

private void button1_Click(object sender, EventArgs e)
{
if (I < i ="="" mayor =" Emax[0];"> mayor)
{
mayor = Emax[I];
pos = I;
}

I++;
}

else
{
button1.Enabled = false;
}
}

private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Add ("El valor maximo es: " + mayor.ToString());
listBox1.Items.Add ("Posicion numero: " + pos.ToString());
}

CODIGOS EN CONSOLA (B)
int[] emax = new int[10];
int I, mayor, pos = 0;

Console.WriteLine("Introduce un munero entero");
emax[0] = int.Parse(Console.ReadLine());
mayor = emax[0];
for (I = 1; I <> mayor)
{
mayor = emax[I];
pos = I;

}
}

Console.WriteLine("Lista de 10 numeros enteros");
for (I = 0; I <>

No hay comentarios:

Publicar un comentario