407,135 views
43 votes
43 votes
program 2. write a VB.NET program to solve the linear equation of the form Ax+B=C, i.e x=(C=B)/A (Eg:2x+3=7, where B and C are consonants, A is the coefficient of x)​

User Photoionized
by
2.6k points

1 Answer

22 votes
22 votes

Answer:

Module Program

Sub Main()

Dim A, B, C, x As Double

A = 2.0

B = 3.0

C = 7.0

x = (C - B) / A

Console.WriteLine($"Solution for {A}x + {B} = {C} is x = {x}")

Console.ReadKey()

End Sub

End Module

Step-by-step explanation:

For A=0, the program wouldn't work, because then any x would be a solution.

User Ishmal Ijaz
by
3.1k points