Function Main
Declare Integer A
Declare Integer B
Declare Integer C
Declare Integer Delta
Declare Real X1
Declare Real X2
Output "Enter coefficient of X^2:"
Input A
Output "Enter coefficient of X:"
Input B
Output "Enter known term:"
Input C
If A = 0
Output "Equarion:"
Assign X1 = -C / B
Output "The solution is X = " & X1
Else
Assign Delta = B^2 - 4*A*C
If Delta < 0
Output "There are no real solutions"
Else
If Delta = 0
Assign X1 = -B / (2*A)
Output "Two real and coincident solutions"
Output "X1 = " & X1
Output "X2 = " & X1
Else
Assign X1 = -B - SQRT(Delta) / (2*A)
Assign X2 = -B + SQRT(Delta) / (2*A)
Output "Two real and distinct solutions"
Output "X1 = " & X1
Output "X2 = " & X2
End
End
End
End
I am Md. Anisur Rahman. I have completed Cyber Security for MSCSE at United International University in 2022.I have completed PGDIT from IIT, Jahangirnagar University in 2020. I'm a Head of IT at Programming24 School.
View all posts by Md. Anisur Rahman