0% found this document useful (0 votes)
7 views1 page

Ppig 9

The document describes a C# program that adds or subtracts two numbers entered in text boxes depending on which radio button is selected and displays the result in a message box. The program uses two text boxes to input numbers, two radio buttons to select the operation, and displays the result in a message box.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Ppig 9

The document describes a C# program that adds or subtracts two numbers entered in text boxes depending on which radio button is selected and displays the result in a message box. The program uses two text boxes to input numbers, two radio buttons to select the operation, and displays the result in a message box.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

PPIG-9:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PPIG_9
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
int n1, n2;
n1=int.Parse(textBox1.Text);
n2=int.Parse(textBox2.Text);
if(radioButton1.Checked == true)
{
int suma=n1 + n2;
MessageBox.Show("El resultado es: "+suma);
}
else
{
if(radioButton2.Checked == true)
{
int resta=n1-n2;
MessageBox.Show("El resultado es: " + resta);
}
}

}
}
}

You might also like