|
-
Jun 21st, 2004, 08:51 AM
#1
Thread Starter
New Member
quadratic equation using functions
How can i put this Vb code in Vb.net Code, and make the same thing but using functions.
Thank's!
Dim A, B, C As Single
Private Sub Command1_Click()
A = Val(A1.Text) '''1
B = Val(B1.Text) '''6
C = Val(C1.Text) '''8
Dim h1, h2, x1, x2
'''h1 = B * B
h2 = B * B - 4 * A * C '''4
'''h2 = h1 + h2
h1 = Sqr(h2) '''2
'''**** h1 ****
'''****** X1 ******
x1 = -1 * B + h1
x1 = x1 / (2 * A)
x2 = -1 * B - h1
x2 = x2 / (2 * A)
x11.Caption = "X1 = " + Str(x1)
x22.Caption = "X2 = " + Str(x2)
End Sub
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
|