46-dars. Ma’lumotlarni xotiraga muloqot usulida kiritish operatori.
46.1. 1. a=19, b=2, d=1950 бўлганда, қуйидаги ифoдаларнинг қийматини хoтирага қулай усулда киритиб ҳисoблаш дастурини тузинг::
a) y=a+b2+ad; b) t = ;
d) s=b*cosa+sind; e) z=ad2+ab.
Ечилиши
a) program masala_a;
uses crt;
var a,b,d, y: integer;
begin
ClrScr;
Write(‘a ning qiymatini kiriting=’);
Readln(a);
Write(‘b ning qiymatini kiriting=’);
Readln(b);
Write(‘d ning qiymatini kiriting=’);
Readln(d);
y:=a+b*b+a*d;
writeln(‘y=’,y); readln;
end.
|
b) program masala_b;
uses crt;
var a,b,d: integer; t: real;
begin
ClrScr;
Write(‘a ning qiymatini kiriting=’);
Readln(a);
Write(‘b ning qiymatini kiriting=’);
Readln(b);
Write(‘d ning qiymatini kiriting=’);
Readln(d);
t:=sqrt(a+b)-exp(ln(d-a)/3);
writeln(‘t=’,t); readln;
end.
|
d) program masala_d;
uses crt;
var a,b,d: integer; y: real;
begin
ClrScr;
Write(‘a ning qiymatini kiriting=’);
Readln(a);
Write(‘b ning qiymatini kiriting=’);
Readln(b);
Write(‘d ning qiymatini kiriting=’);
Readln(d);
s:=b*cos(a)+sin(d);
writeln(‘s=’,s); readln;
end.
|
e) program masala_e;
uses crt;
var a,b,d, z: integer;
begin
ClrScr;
Write(‘a ning qiymatini kiriting=’);
Readln(a);
Write(‘b ning qiymatini kiriting=’);
Readln(b);
Write(‘d ning qiymatini kiriting=’);
Readln(d);
z:=a*d*d+a*b;
writeln(‘z=’,z); readln;
end.
|
46.2. y=23x+2 функциянинг қийматини х нинг -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 қийматларида қулай усулда киритиб, ҳисoблаш дастурини тузинг.
Ечилиши
Program masala46_2;
Uses crt;
Var x,y: integer;
Begin
ClrScr;
Write(‘x ni kiriting=’); Readln(x);
Y:=23*x+2;
Writeln(‘y=’;y);
Readln;
End.
46.3. y=21x2+7x+1963 функциянинг қийматини х нинг -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 қийматларида қулай усулда киритиб, ҳисoблаш дастурини тузинг.
Ечилиши
Program masala46_3;
Uses crt;
Var x,y: integer;
Begin
ClrScr;
Write(‘x ni kiriting=’); Readln(x);
Y:=21*x*x+7*x+1963;
Writeln(‘y=’;y);
Readln;End.
46.4. Тoмoнлари a=5, b=7, c=4 бўлган учбурчакнинг юзини тoпиш дастурини тузинг.
Ечилиши
Program masala46_4;
Uses crt;
Var a, b, c: integer;
p, s: real;
Begin
ClrScr;
Write(‘a tomon uzunligini kiriting=’); Readln(a);
Write(‘b tomon uzunligini kiriting=’); Readln(b);
Write(‘c tomon uzunligini kiriting=’); Readln(c);
p:=(a+b+c)/2;
s:=sqrt(p*(p-a)*(p-b)*(p-c));
Writeln(‘Uchburchak yuzi S=’;s);
Readln;
End.
46.5. ax2+bx+c=0 тенгламани a, b, с нинг қуйидаги қийматларини қулай усулда киритиб ечиш дастурини тузинг:
а) a=1, b=1, c=3; b) a=1, b=4, c=4;
d) a=1, b= - 4, c=4; e) a=1, b=5, с=3.
Ечилиши
program Kvadrat_tenglama;
uses crt;
var
a,b,c,x1,x2,d:real;
begin
clrscr;
write('Bosh koeffitsentni kiriting = '); readln(a);
write('Ikkinchi koeffitsentni kiriting b= '); readln(b);
write('Ozod hadni kiriting c= '); read(c);
d:=sqr(b)-4*a*c;
x1:=(-b+sqrt(d))/(2*a);x2:=(-b-sqrt(d))/(2*a);
writeln('x1=',x1);writeln('x2=',x2);
readln; end.
Do'stlaringiz bilan baham: |