Help with coding an application that will calculate the square and square root
How do I go about coding the 'Calculate button' so that when a user is prompted to input a number into a Input box it will will calculate the square and square root of it?
This is what I have so far. I'm pretty sure about the first part, but am confused about the square root part.
Private Sub cmdCalc_Click()
‘calculate square of a number
lblTsquare.Caption=txtNumber^2
‘calculate square root of a number
txtNumber.Text = Sqr(txtNumber.Text)
End Sub
2
Contributors
4
Replies
14 Hours
Discussion Span
3 Years Ago
Last Updated
5
Views
Question Answered
Related Article:VB/VS 2008 and database
is a Visual Basic 4 / 5 / 6 discussion thread by Xadavus that has 8 replies and was last updated 4 years ago.
Private Sub cmdSquare_Click()
'calculate square of a number
lblTSquare.Caption = txtNumber ^ 2
'calculate square root of a number
lblTroot.Caption = Sqr(txtNumber.Text)
End Sub