Informatika fanidan 9-sinf uchun nazorat ishi topshiriqlari yechimlari
II variant.
1.Uchta a, b va c sonlar berilgan. Agar a2+b2=c2 shart bajarilsa, bu sonlarning yig`indisini , aks holda ularning modullari ko`paytmasini hisoblovchi dastur tuzing.
Program masala;
Uses crt;
Var a,b,c,n: integer;
Begin
Write (‘ a ning qiymatini kirit’); Readln (a);
Write (‘ b ning qiymatini kirit’); Readln (b);
Write (‘ c ning qiymatini kirit’); Readln (c);
If sqr(a)+sqr(b)=sqr(c) then n:=a+b+c else n:=abs(a)*abs(b)*abs(c);
Writeln (‘n=’,n);
Readln;
End.
2.Erkin tushayotgan jismning t vaqt ichida bosib o`tgan yo`lini hisoblash dasturini tuzing.
Program masala;
Uses crt;
Var S,t, g: real;
Begin
g:= 9,8;
Write (‘ t ning qiymatini kirit’); Readln (t);
S: =g*sqr(t)/2;
Writeln (‘ S=’,S);
Readln;
End.
“Obod turmush yili” matnini ekranning o`ng tomonidan 12-satrda yashil rangda , qizil fonda chiqaruvchi dastur tuzing.
Program masala;
Uses crt;
Begin
TextGolor (2); TextBackGround(4);
Goto XY (65,12); Write (‘ Obod turmush yili’);
Readln;
End.
|