C# dairenin alanını ve çevresini hesaplayan program

Konu sahibi son olarak 3309 gün önce görüldü
Kod:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
const float pi=3.14f;
double alan,cevre,r;

Kod:
private void button1_Click(object sender, EventArgs e)
{
r = double.Parse(textBox1.Text);
alan = pi * r * r;
textBox2.Text = alan.ToString();
}

Kod:
private void button2_Click(object sender, EventArgs e)
{
cevre = 2 * pi * r;
textBox2.Text = cevre.ToString();
}
}
}
 
Geri