Solve Quadratic Equation (Pseudocode If Else Example)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
BEGIN NUMBER a, b, c, d, x1, x2 INPUT a,b,c d = b^2-4ac IF (d >= 0) THEN x1 = (-b+√d)/2a or x1 = (-b+d^(1/2)/2a x2 = (-b-√d)/2a or x2 = (-b-d^(1/2)/2a OUTPUT "ROOT 1:"+x1 OUTPUT "ROOT 2:"+x2 ELSE IF (d == 0) THEN x1=x2= -b/2a OUTPUT "ROOT 1:"+x1 OUTPUT "ROOT 2:"+x2 ELSE OUTPUT "There is no real root" ENDIF END |
Flowchart of Pseudocode
What is the use of the “yada” in the code
I had copied the code from my Turkish site. I had forgotten translate “yada” to “or”. “yada” is mean in Turkish “or”