namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } const double PI = 3.14159; private void btArea_Click(object sender, EventArgs e) { double radius = Convert.ToDouble(txtRadius.Text); double area = PI * radius * radius; MessageBox.Show("The arae of circle = " + area.ToString("#,###.##"), "Area"); } private void btCircumference_Click(object sender, EventArgs e) { double radius = Convert.ToDouble(txtRadius.Text); double circumference = 2 * PI * radius; MessageBox.Show("The circumference of circle = " + circumference.ToString("#,###.##"), "Circumference"); } } }
Sign up here with your email
ConversionConversion EmoticonEmoticon