Chiziqli dasturlar tuzish


–misol. Tomonlari mos ravishda a, b, c bo‘lgan ixtiyoriy uchburchakning yuzini Geron formulasi orqali hisoblash dasturini tuzing va a=3, b=4, c=5 qiymatlarda hisoblang


Download 124.56 Kb.
bet14/16
Sana09.01.2022
Hajmi124.56 Kb.
#263566
1   ...   8   9   10   11   12   13   14   15   16
Bog'liq
lobar

2–misol. Tomonlari mos ravishda a, b, c bo‘lgan ixtiyoriy uchburchakning yuzini Geron formulasi orqali hisoblash dasturini tuzing va a=3, b=4, c=5 qiymatlarda hisoblang.


I usul

II usul

Program Uchburchak_yuzi;

Var a,b,c:Integer; {uchburchak tomonlari}

yp,s:Real; {yp-yarim perimetr, s-yuza}

Begin

a:=3; b:=4; c:=5; yp:=(a+b+c)/2;

s:=sqrt(yp*(yp-a)*(yp-b)*(yp-c));

WriteLn(‘S= ‘,s,‘ kvadrat birlik‘);

Readln;

End.

Program Uchburchak_yuzi;

Var a,b,c:Integer; {uchburchak tomonlari}

yp,s:Real; {yp-yarim perimetr, s-yuza}

Begin

Write(‘a,b,c ning qiymatlari kiritilsin ‘);

ReadLn(a,b,c); yp:=(a+b+c)/2;

s:=sqrt(yp*(yp-a)*(yp-b)*(yp-c));

WriteLn(‘S=‘,s:2:2,‘ kvadrat birlik‘); readln;

End.

Download 124.56 Kb.

Do'stlaringiz bilan baham:
1   ...   8   9   10   11   12   13   14   15   16




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling