namespace practica_6._4_console
{
class Program
{
static void Main(string[] args)
{
double x, y;
Console.WriteLine("\t\tfuncion matematica");
Console.WriteLine("\nvalor de x t\t\tvalor de y");
for (x = 1; x <= 5; x = x + 0.1)
{
y = 1.0 + x + Math.Pow(x, 2) / 2.0 + Math.Pow(x, 3) / 6.0 + Math.Pow(x, 4)/24.0;
Console.WriteLine("{0} \t\t\t{1} ", x, y);
}
Console.ReadLine();
PRACTICA EN WINDOWS
namespace PRACTICA_6._4_WINDOWS
{
public partial class Form1 : Form
{
double x, y;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double x, y;
listBox1.Items.Add("VALOR DE X \tVALOR DE Y");
for (x = 1; x <= 5; x = x + 0.1)
{
y = 1 + x + Math.Pow(x, 2) / 2.0 + Math.Pow(x, 3) / 6.0 + Math.Pow(x, 4) / 24.0;
listBox1.Items.Add(x.ToString() + "\t\t" + y.ToString());
}
}
private void button3_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
}
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario