1 Replies - 484 Views - Last Post: 15 November 2019 - 04:53 PM Rate Topic: -----

#1 carlos77   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 03-November 18

Sqrt root of a number

Posted 15 November 2019 - 04:14 PM

Hi!
would you please help me with a code for a formula of sqrt root

exam
(sqrt(9)+2)^2 = 25 in visual basic Studio 10


Public Class Form1

This is the code but only get the sqrt root and I would like to add +2 and resquared
----------------------------------------------------------------------------------------------------

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim num1 As Integer
        num1 = Val(TextBox1.Text)
        TextBox2.Text = Math.Sqrt(num1)

    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub

    Private Function Sqrt() As Integer
        Throw New NotImplementedException
    End Function

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged

    End Sub
End Class

:code:



Thanks

Best regards

Carlos

This post has been edited by modi123_1: 15 November 2019 - 04:21 PM
Reason for edit:: In the future please use the [code] tag button in the editor


Is This A Good Question/Topic? 0
  • +

Replies To: Sqrt root of a number

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15728
  • View blog
  • Posts: 63,014
  • Joined: 12-June 08

Re: Sqrt root of a number

Posted 15 November 2019 - 04:53 PM

03	        num1 = Val(TextBox1.Text)
04	        TextBox2.Text = Math.Sqrt(num1)

Why not implement your math in there? Between lines 3 and 4?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1