xl = -С/В
W rite “R oot =”, xl
goto step 5
End
End
3 .D = B x B - 4 . 0 x A x C
4. IF D > 0 T H E N
Begin
W rite “Real and distinct roots” xl = (-B + V
d
) / (2.0 X A)
x2 = (-B - VD ) / (2.0 x A)
W rite “First root =”, xl W rite “Second root =”, x2
End
E LSE
Begin
IF (D = 0) T H E N
Begin
W rite “Real and equal roots” xl = -B / (2.0 x A) x2 = xl
W rite “First root =”, xl W rite “Second root
x2
End
E LSE
Begin
Write “Im aginary roots” xl = -B / (2.0 x A) x2 = xl
yl = V -I) / (2.0 x A) y2 = -yl
W rite “First root”
W rite “Real part”, xl, “Img. part”, yl W rite “Second root ”
Write “Real part”, x2, “Img. part”, y2
End
End
5. END.
11.3.
A L G O R IT M : M assiv elem en tlarin i yig‘n disini aniqlash.
20 elementni yig‘indisini topish kerak.
NUM sonlar joyi
aniqlanadi.
SUM y ig ‘indisi saqlanadi.
l.S U M < - 0
2.
NUM <-
277
3. Repeat for COUNT = 1 ,2 ,, 20
Begin
SUM <- SUM + NUM
NUM <- NUM + 4
End
4. Write “Sum of 20 terms is”, SUM
5. End.
Dostları ilə paylaş: