


Código:
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 WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//variables
int n1;
int n2;
//Asignacion de valores alas variables
n1 = System.Int32.Parse(textBox1.Text);
n2 = System.Int32.Parse(textBox2.Text);
//condicion
if (n1 > n2)
textBox4.Text = n1.ToString();
else
textBox4.Text = n2.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
textBox4.Text = "";
textBox1.Focus();
}
}
}