{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Introduce valor W=");
double W = double.Parse
(Console.ReadLine());
double Z = (1.0 / Math.Sqrt(2 * Math.PI)) * Math.Exp(-W * W / 2);
Console.WriteLine("Z=" + Z);
Console.ReadKey();
}
}
}
namespace practica4_3V
{
public partial class Form1 : Form
{
double W, Z;
public Form1()
{
InitializeComponent();
W = Z = 0.0;
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
W = double.Parse(textBox1.Text);
Z = (1.0 / Math.Sqrt(2 * Math.PI)) * Math.Exp((-W * W) / 2);
label2.Text = "Z es:" + Z;
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox1.Focus();
label2.Text = "";
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}


No hay comentarios:
Publicar un comentario