|
-
Jul 28th, 2004, 09:02 AM
#1
Thread Starter
New Member
need some help
I have been trying this over and over and over again. I am trying to write code to "find the larger of two numbers". Could anyone help me on this? Here is what I have so far. Thanks to all in advance :-)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Find the larger of two numbers input by the user'.
Dim num1, num2, largerNum As Double
Dim txtFirstNum, txtSecondNum, txtResults
num1 = CDbl(txtFirstNum.Text)
num2 = CDbl(txtSecondNum.Text)
If num1 > num2 Then
largerNum = num1
Else
largerNum = num2
End If
txtResults.Text = "The larger number is " & largerNum
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|