VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Solve two equations and two unknowns

by mohamed gamal abas (Eygpt - Monofia) (1 Submission)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 30th August 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Solve two equations and two unknowns

Rate Solve two equations and two unknowns



  Dim a As Single, b As Single, c As Single
  Dim d As Single, e As Single, f As Single
  Dim X As Single, Y As Single
  Dim delta As Single, delta1 As Single, delta2 As Single
  a = Val(txta.Text)
  b = Val(txtb.Text)
  c = Val(txtc.Text)
  d = Val(txtd.Text)
  e = Val(txte.Text)
  f = Val(txtf.Text)
  delta = (a * e) - (b * d)
  delta1 = (c * e) - (b * f)
  delta2 = (a * f) - (c * d)
  If delta = 0 Then
  MsgBox "no solve exist", vbInformation, "invalid"
  Else
  X = delta1 / delta
  Y = delta2 / delta
  txtx.Text = X
  txty.Text = Y
  End If
  
  End Sub

Download this snippet    Add to My Saved Code

Solve two equations and two unknowns Comments

No comments have been posted about Solve two equations and two unknowns. Why not be the first to post a comment about Solve two equations and two unknowns.

Post your comment

Subject:
Message:
0/1000 characters