Programmalash asoslari fani aliyeva Maxsuda Xalilovna


Download 0.86 Mb.
bet4/6
Sana13.08.2020
Hajmi0.86 Mb.
#126144
1   2   3   4   5   6
Bog'liq
programmalash asоslari uz ALIYEVA M.X doc


Qiyinlik darajasi1

Berilgan if x

max(x,y) masalasini

min(x,y) masalasini

x va y larning yig’indisini toppish

min(y,x) masalasini

106 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi3

Programma fragmenti natihasini aniqlang? k:=40;

case k mod 4 of

0: write(‘k=4m’);

1:= write(‘k=4m+1’);

2: write(‘k=4m+2’);

3: write(‘k=4m+3’);

end;


k=4m

k=4m+1

k=4m+2

k=4m+3

107 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi1

Z ning qiymati nimaga teng?

begin a:=2; b:=17; c:=6;

Z:=b div a + b mod c; write(z) end.


13

16

11

15

108 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi1

Berilgan operatorlarning bajarilishi natijasida EHM quyidagini chop etadi. n:=5; n:=n+1; write(‘n teng ’, n);

n teng 6

n=6

n teng 5

n=5

109 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

PASKAL-programmaning qaysi joyida sintaktik xato mavjud?

program m1;

var x,y,z: real;

begin read(x,y,z);

if x

write(z,exp(3*ln(abs(z))))

end.


shartli operatorida

programmani sarlavxasi operatorida

o’zgaruvchilarni tasvirlashda

natijalarni chikarish operatorida

110 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Arifmetik ifodada amallar bajarilishi tartibi qanday? 1) Funksiyalar qiymati xisoblanadi.

2) *, /, div, mod

3) +, -


1,2,3

3,2,1

2,3,1

1,3,2

111 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Paskal tilida yozilgan ifoda berilgan:

n*ln(abs(a*x-1)) + (x+b) + sin(a*x/12)

Bu qanday algebraik ifodani bildiradi?


nln(/ax-1/) +(x+b) + sin( ax/12 )

nln ax-1 +(x+b) + tg( ax/12 )

nln ax-1 +(x+b) tg( ax/12 )

nln(ax-1) +(x+b) + sin( ax/12 )

112 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Quyida keltirilgan programma fragmentida qaysi xato bor?

Var a,b:real; c,d:integer; a:=(bc);



ta’minlash operatorining chap va ung tomonlarini tiplari mos emas

taminlash operatorida mantiqiy ifoda qatnashayapti

d butun o’zgaruvchi sifatida tasvirlangan

b haqiqiy o’zgaruvchi sifatida tasvirlangan

113 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Quydagi ifoda a=5, b=15, c=2 bo’lsa qanday natija beradi? ( a+ b div c * 4 ) mod 5 div 3

1

4

3

2

114 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Quydagi belgilar ketma-ketligidan qaysi biri taminlash operatori?

1) a+1:= b; 2) a=c+1; 3) a:b-sqr(2); 4) r:=exp(a*x+b);



4

3

2

1

116 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Operasiyalar natijasini to’g’ri tanlang. round(trunc(-5,875) +0.8)+5

-1

10

9

2

117 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Y ning qiymati nimaga teng?

VAR X,Y:REAL;

BEGIN X:=5.7;

IF X<2 THEN Y:=sqr(X) ELSE

IF X<5 THEN Y:=2 ELSE Y:=X-5;

Y:=ROUND(Y)

END.


1

5

25

2

118 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

X qaysi qiymatni qabul qiladi?

VAR X,Y: integer;

K:CHAR;

BEGIN X:=10; Y:=2; K:='-';



CASE K OF

'+': X:=X+Y;

'-': X:=X-Y;

'*': X:=X*Y;

'/': X:=X/Y

end


END.

8

12

20

5

120 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

X qaysi qiymatni qabul qiladi?

TYPE P= (dush, sesh, chorsh, psh, juma, shan, yaksh);

VAR DEN:P; X:INTEGER;

BEGIN DEN:=psh;

CASE ORD(DEN) OF

1: X:=10;

2: X:=20;

3: X:=30;

4: X:=40;

5: X:=50


END

END.


40

20

10

30

121 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

X qaysi qiymatni qabul qiladi ?

VAR i,j,X: integer;

BEGIN

FOR i:=1 TO 2 DO



FOR j:=2 DOWNTO 1 DO X:=i+j;

END.


3

4

2

1

122 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Y qiymati nimaga teng ?

TYPE M = array [1..4] of real;

VAR a : M ; x,y: real;

BEGIN a[1]:=14; a[2]:=10; a[3]:=a[1]-a[2]; X:=a[3]; y:=sqr(x); END.



16

14

10

36

123 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

A[2] qaysi qiymatni qabul qiladi?

VAR A : array [1..10] of real;

i:integer;

BEGIN


FOR i:=1 TO 4 DO

IF i >=2 THEN A[i]:=i-1 ELSE A[i]:=I END.



1

0

2

3

125 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Programma bajarilgandan so'ng W ni qiymati nimaga teng?.

VAR X,U,Z,W: INTEGER;

BEGIN X:=5; Z:=SUCC(X); U:=PRED(Z+X);

W:=Z+U


END.

16

10

14

12

126 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Z ni qiymati nimaga teng?

VAR X,Y,Z:INTEGER;

BEGIN X:=15; Y:=X MOD 4;

Z:=X DIV 2; Z:=Z-Y END.



4

15

12

0

127 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Quyida keltirilgan PASKAL-programmaning ishlashi natijasida nima hisoblanadi?

program m1;

var x,y,z: real;

begin read(x,y,z);

if x

if x

write(x)

end.


x , y , z sonlarning eng kattasi

x , y sonlarning eng kattasi

y , z sonlarning eng kattasi

x , y sonlarning eng kichigi

128 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

N ning qiymatini aniqlang.

program vv;

var N,i: integer;

Begin N:=5;

for i:=1 to N do

N:=N+1; write(N);



N ning qiymati xar safar oshib ketishi sababli, cheksizdir

10

30

N ning qiymati mavjud emas

129 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Programma nimani chop etadi?

VAR A,i: integer;

FUNCTION NT(n,m:integer):integer;

Begin NT:=n-m end;

BEGIN A:=0;

FOR i:=1 TO 2 DO A:=A+NT(2,1); Write('A=',A)

END.


A=2

A=1

A=0

A=3

130 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Quyida S ning qiymati nimaga teng?

begin


S:=0;

for I:=1 to 3 do S:=S+2*i;

writeln(S);

end.


12

24

48

96

132 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Quyida S ning qiymati nimaga teng?

begin for j:=-2 to 3 do begin S:=0; S:=S+(j+1); end; writeln(S); end.



4

10

6

2

133 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Sharti oldin qo’yilgan sikl operatoridagi so’zlar qaysi?

while, do

for, to, do

if, then, else

goto

134 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Quydagi belgilar ketma-ketligilardan qaysi biri sharti oldin berilgan sikl operatori?

While do

While Then

If do

If Then

135 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Quydagi belgilar ketmaketligilardan qaysi biri sharti keyin berilgan sikl operatori?

Repeat until

Repeat do

While do

Repeat do

136 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Quydagi belgilar ketma-ketligilardan qaysi biri parametrli sikl operatori?

For := To D0

For := To D0

While do

For := To D0

137 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Parametrli sikl operatori xizmat suzlari qaysi javobda tugri keltirilgan?

for, to, do

if, then, else

Goto

while, do

138 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Quyidagi operator necha marta takrorlanadi? for x:=1 downto 10 do write (x);

0 marta

1 marta

10 marta

5 marta

139 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Quyida write operatori necha marta bajariladi?

for i:=1 to 3 do for j:=0 to 3 do write (i+j);



12 marta

9 marta

10 marta

3 marta

140 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Programmaning to’g’ri natijasini toping.

program m1;

var x: real;

begin x:= -3.6; while x <= 0 do begin write (x); x:=x+1 end end.



x=-3.6 x=-2.6 x=-1.6 x=-0.6

x=-3.6 x=-2.4 x=-1.2 x=-0.1

x=-1.6 x=-2.6 x=-3.6 x=-4.6

x=-2.6 x=-1.6 x=-0.6 x= 1.6

141 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Qiyinlik darajasi2

Takrorlash operatorlaridan qaysi biri chekli sondagi qadamlardan so’ng o’z ishini tugatadi?, agar x=-3; y=0.5; a=5; b=4

While x<0 do x:=x+0.5;

While x<0 do x:=x-100;

While 0

While a>0 do y:=2*y;

142 Manba – A.A.Xaldjigitov, Sh.F.Madraximov, U.E.Adamboev. Informatika va programmalsh.



Download 0.86 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6




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