lunes, 26 de octubre de 2009

Practica 7.3 Visual

PSEUDOCODIGO
FLOAT n, p, exp;

p = 1;

PRINT("introduce un numero");

READ n

while (p <= n)

{


exp = Math.Pow(p, p);



PRINT( p, p, exp);

p = p + 1;

}

FINAL










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 WindowsFormsApplication4
{
public partial class Form1 : Form
{
double n, x, y;
public Form1()
{
x = 1;
n = y;
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
n = double.Parse(textBox1.Text);
listBox1.Items.Add("Numero Potencia Resultado");
for (x = 0; x <= n; x = x + 0)
{
y = 1 * Math.Pow(x, 1) + 1 * Math.Pow(x, 2) + 1 + x++;
listBox1.Items.Add(" " + x.ToString() + " " + x.ToString() + " " + y.ToString());
}
}


private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{

}
}
}

No hay comentarios:

Publicar un comentario