Programs in Basic'
Programs in Basic'
Presentation By
Jayakanth C V
NO:20
PROGRAM
A1X1+A2X2=B1
A3X1+A4X2=B2
Since there are only two equations, we may find the
solution by the formulas
BASIC Program for Solving two
Simultaneous linear Equations
10 READ A1, A2, A3,A4
15 LET D= A1*A4-A3*A2
20 IF D=0 THEN 65
30 READ B1, B2
37 LET X1= (B1*A4-B2*A2)/D
42 LET X2= (A1*B2-A3*B1)/D
55 PRINT “X1=“; X1
56 PRINT “X2=“; X2
60 GO TO 90
65 PRINT “NO UNIQUE SOLUTION”
70 DATA 1, 2, 4,2
80 DATA -7, 5
90 END
Interpretation
First statement, numbered 10, is a READ
statement.
The variables whose names are listed after the
READ will be given values according to the next
available numbers in the DATA statements.
The statement, numbered 15, is LET statement.
It compute the value of the expression A1A4-A3A2,
and assigns this value to the variable D.
Interpretation cntd…