using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace practica_10._1_windos
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double[] pendiente = { 17.24, 25.63, 5.94, 33.92, 3.71, 2.84, 35.93, 18.24, 6.92 };
double mayor = pendiente[0];
double menor = pendiente[0];
int i;
listBox1.Items.Add("Pendientes:");
for (i = 0; i <= 8; i = i + 1)
{
listBox1.Items.Add(pendiente[i]);
if (pendiente[i] > mayor)
{
mayor = pendiente[i];
}
if (pendiente[i] <>
{
menor = pendiente[i];
}
}
label1.Text = ("\nDato Mayor: " + mayor);
label2.Text = ("Dato Menor: " + menor);
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
label1.Text = "";
label2.Text = "";
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
No hay comentarios:
Publicar un comentario