double num1, num2;
float suma()
{
return num1 + num2;
}
float multiplicacion()
{
return num1 * num2;
}
READ num1
READ num2
double a1 = suma();
double a2 = multiplicacion();
PRINT a1
PRINT a2
FIN
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 PRATICA_12._2_WINDOWS
{
public partial class Form1 : Form
{
double num1, num2;
double suma()
{
return num1 + num2;
}
double multiplicacion()
{
return num1 * num2;
}
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
num1= double.Parse(textBox1.Text);
num2= double.Parse(textBox2.Text);
double a1 = suma();
double a2 = multiplicacion();
label3.Text = ("la Suma es :" + a1);
label4.Text=("\n\nLa multiplicacion es : "+a2);
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
}
}
}
No hay comentarios:
Publicar un comentario