Write “Biggest number is”, С
lind
ELSE
Begin
IF (В
> C)
THEN
Write “Biggest number is”,
В
ELSE
Write “Biggest number is”, С
End
3 . E N D .
ALGORITM : Uchburchakni yuzini topish.
Uchburchakni uchta tomoni berilgan А, В, C.
Biz ushbu
uchburchakni yuzini topishimiz kerak. S - perimetr.
1. INPUT А, В, С
2.
IF
(((A+B) >C) AND ((B+C) >A) AND ((C+A) >B))
THEN
Begin
S
<-
(A
+ В +
C)/2
Area <- VS x (S - A) x (S - B) x (S - C)
Write “Area o f triangle is”, Area, “sq. units”
End
ELSE
Write “Triangle is not possible”
3. END.
ALGORITM: Kvadrat tenglamani ildizini aniqlash.
Kvadrat tenglamani ildizini aniqlash (Ax2 + Bx + С = 0)
1. INPUT А, В, С
2 .I F A =
0TH EN
Begin
IF
В =
0 THEN
Begin
Write “Equation is degenerate” goto step 5
End
ELSE
Begin
Write “Linear equation has single root”
276
xl = -С/В
Write “Root =”, xl
goto step 5
End
End
3. D = В x В - 4.0 x A x С
4.
IF D > 0 THEN
Begin
Write “Real and distinct roots” xl =
(-B
I Vd) / (2.0 X A)
x2 = (-B — VD ) / (2.0 x A)
Write “First root — xl Write “Second root ”, x2
End