Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. using System.Linq;
  2. using System.Text;
  3. using System.Threading.Tasks;
  4. using System.Windows.Forms;
  5.  
  6. namespace RR
  7. {
  8. public partial class Form1 : Form
  9. {
  10. public Form1()
  11. {
  12. InitializeComponent();
  13. }
  14.  
  15. private void button1_Click(object sender, EventArgs e)
  16. {
  17. double result = (Convert.ToInt32(textBox1.Text) + Convert.ToInt32(textBox2.Text) + Convert.ToInt32(textBox3.Text)) / 3;
  18. textBox4.Text = Convert.ToString(result);
  19.  
  20. }
  21.  
  22. private void button2_Click(object sender, EventArgs e)
  23. {
  24. /* double result2 = Math.Sqrt(Math.Pow((Convert.ToDouble(textBox1.Text)), 2) + Math.Pow((Convert.ToDouble(textBox1.Text)), 2) + Math.Pow((Convert.ToDouble(textBox1.Text)), 2)); */
  25. double result2 = Math.Sqrt(Math.Pow(Convert.ToDouble(textBox1.Text), 2) + Math.Pow(Convert.ToDouble(textBox2.Text), 2) + Math.Pow(Convert.ToDouble(textBox3.Text), 2));
  26. textBox5.Text = Convert.ToString(result2);
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement