button1_Click
event handler and do the following code for calculating the volume of a cylinder.
private void button1_Click(object sender, EventArgs e) { //declaring variables double inp_based = 0; double inp_height = 0; double pi = 3.14; double volume = 0; //passing the value of a textbox in the variables inp_based = double.Parse(txtBase.Text); inp_height = double.Parse(txtHieght.Text); // Set the formula to get the volume of a cylinder volume = ((inp_based * inp_based) * inp_height) * pi; //displaying the result txtOutput.Text = "The volume of a cylinder is : " + volume.ToString() + " m3"; }