domingo, 11 de octubre de 2009

Practica 6.1 Visual


Pseudocodigo


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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
double n, factor = 1.0, I;
n = double.Parse(N.Text);
label2.Text = "Su factorial es: ";

for (I = n; I >= 1; I--)
{
factor = factor * I;

}
label2.Text = label2.Text + factor.ToString();

}

private void button2_Click(object sender, EventArgs e)
{
N.Clear();
label2.Text = " ";

}

private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}

No hay comentarios:

Publicar un comentario