funksiyani yopish
funksiyani tafsivlash
funksiyani aniqlash
funksiyaga murojoat
95.Qaysi funksiya tasodifiy sonlarni hosil qilish uchun ishlatiladi?
srand
return
randomize
rand
96.O’z-o’ziga murojoat qiliuvchi funksiya-bu..
rekursiv funksiya
prototip funksiya
global funksiya
bazaviy funksiya
97. Buyruqlar natijasini aniqlang: Setcolor(4); circle(120,50,20); line(10,20,100,20)
aylana, nuqta
doira, kesma
doira,nuqta
kesma, aylana
98.Grafik rejimida matnlarni kiritish funksiyasi:
couttext (x,y,m)
couttextxy (x,y,m)
outtext (x,y,m)
outtextxy (x,y,m)
99. Hisoblash natijasini aniqlang
float ter(float a, float b:real)
{ float y; if (a>b) y=a; else y=b; return y; } {float c,d, z; c=3; d=-2; z=(2*ter(d*2,c)+ter(d+c,2*c))/2; cout<
4
4,5
5
6
100. Hisoblash natijasini aniqlang
{float a[5],b[5],s; int i,j; for(i=1; i<5; i=i+1) {s=0; a[i]=i+3; s=s+a[i]; } cout<
4
5
6
7
101. Hisoblash natijasini aniqlang:{ float a[5],b[5],s=0; int i,j; for(i=1; i<4; i=i+1) b[i]=i+2; for(j=1; j<5; j=j+1) a[j]=j*2; s=s+a[2]*b[3]; cout<
12
14
16
20
102. C++ tilida quyidagi programma qismi ishlaganda ekranga qanday natija chiqadi? int i,s=0;
for (i=1;i<10;i++)
{ s+=i; i++; }
cout<
1
10
25
45
103. Qaysi qatorda DO WHILE operatorlari to’g’ri yozilgaт?
i=10; s=0;
do s+=1/i; i--; while i<0;
i=10; s=0;
do { s+=1/i; i++; } while (i<0);
i=10; s=0;
do s+=1/i; i--; while (i>0);
i=10; s=0;
do { s+=1/i; i--; } while (i>0);
104. Dastur natijasini aniqlang:
main()
int main()
{int a=4,b=6,c=1,s,d,f;
s=a++;
d=--a+c--;
f=acout<<"s= "< return 0;
}
s=4, f=0, d=4
s=4, f=0, d=5
s=4, f=1, d=5
s=4, f=1, d=6
105. Butun sonli arifmetika ishlatiladigan amalni ko’rsating:
!!
%
&&
**
106. For operatori to’g’ri foydalanilgan qatorni ko’sating:
main ()
{ int i, j; for(i=6; j=0; j<10; i=i--1, j=j+; cout<
main ()
{ int i, j; for(i=6, j=0; j<10; i=i-1; j=j+ cout<
main ()
{ int i, j; for(i=6, j=0, j<10; i=i-1, j=j+1cout<
main ()
{ int i, j; for(i=6, j=0; j<10; i=i-1, j=j+1cout<
107. Dastur natijasi nimaga teng?
int main()
{ float x=3, y=2;
if (x>y) x=4*pow(y,2);else
y=sqrt(x)+2; x=2*y;
cout< return 0;
}
4 2 4
4 4 2
4 4 4
4 6 4
108. Dastur natijasi nimaga teng?
int main()
{ float x=3, y=2;
x=4*pow(y,2); y=sqrt(x)+2; x=2*y;
cout< return 0;
}
3 6 12
12 6 12
16 6 12
12 12 12
109. To’g’ri yozilgan dasturni toping: ni hisoblash.
k=1; while (k<=n) z=x+k*y; k++;
k=1; while (k<=n) { z=x+k*y; k++; }
k=1; while (k
k=1; while (k
110. To’g’ri yozilgan operatorni toping: agar x va y lardan bittasi manfiy bo’lsa, u holda son 0,5 ga oshirilsin.
if ( x<0 || y<0) {x=x+0.5; y=y+0.5;}
if ( x<0 && y<0) {x=x+0.5; y=y+0.5;}
if ( x<0 ! y<0) {x=x+0.5; y=y+0.5;}
if ( x<0 || y<0) x=x+0.5; y=y+0.5;
111. To’g’ri yozilgan operatorni toping:agar ikki sonning yig’indisi 1 dan kichik bo’lsa ularning o’rta arifmetigin, aks holda ularning o’rta geometrigini hisoblang.
if (x+y< s=(x+y)/2 else s=sqrt(x*y);
if (x+y< s=(x+y)/2; else s=sqrt(x*y);
if (x+y< s=x+y/2 else s=sqrt(x*y);
if (x+y> s=x+y/2; else s=sqr(x* y);
112. Dastur natijasini aniqlang:
main()
{int s=7, t=9, z=7, x, y, f;
x=!(s>t)||(s>z);
y=++x+--z;
f=!(y>=z);
cout<<“x= “<
x=2, y=7, f=0
x=2, y=8, f=0
x=2, y=8, f=1
x=2, y=9, f=0
113. Ifoda to’g’ri yozilgan satrni ko’rsating:
114. Ifodani qiymati nimaga tеng? 24/(3*4)-24/3/4+24/3*4
4
12
16
32
115. Dastur natijasini aniqlang:
int main()
{int x=4, y=3, w =1, t;
w++;
t=++x-y;
y--;
cout<<"t=”<< t<
t=1,2,1,3
t=2,5,2,2
t=2,4,2,3
t=3,4,3,2
116. Dastur natijasini aniqlang:
main()
{ int a,i;
for(i=3,a=2;a<25;a=a*i) i=i+1;
cout<<”a=”<
40 5
a=120 i=5
a=40 i=5
a=5 i=120
117. Ifoda to’g’ri yozilgan satrni ko’rsating:
y=pow(1/5, pow(x,++ pow(sin(x,)+tg(pow(3,x));
y=pow(1/5,pow(x,++sin(pow(4, x))+tan(pow(3, x));
y=pow(pow(x,+4,1/+sin(pow(x,)+ pow(tan(x,3);
y=pow(pow(x,+4,1/+sin(pow(x,)+tan(pow(x,3);
118.To'g'ri yozilgan operatorni ko'rsating:
cin>>"a="<
cin>>"a=">>a>>"b="'>>b
cin>>"a=">>a>>'b='>>b;
cin>>a>>b<
119. Dastur natijasini aniqlang:
int main()
{int i=3, p=1;
for(;i*i*i>0;i=i- p*=i*(i+;
cout<<"i="<< i<<"p="<< p;
return 0;
}
i=0, p=72
i=0, p=144
i=1, p=72
i=1, p=144
120. int i=0, j=0;for (i=0, j++; i<10; i++); j--; cout<
10 0
11 1
10 10
11 11
121.Dastur natijasini aniqlang:
main()
{ int a,i;
for(i=3,a=2;a<25;a=a*i) i=i+1;
cout<<”a=”<
a=120 i=5
a=40 i=5
a=5 i=120
a=5 i=40
122. Tavsiflash to'g'ri berilgan qatorni ko'rsating:
int i;k;l , float s;h;t , char z,v ;
int i,k,l ; float s,h,t ; char z,v ;
int i,k,l , float s,h,t , char z,v ;
int i,j,k ; float a,b,c; char f,c;
123. C++ tilida quyidagi programma qismi ishlaganda ekranga qanday natija chiqadi? int a=123456,d=0,c=1; do { int i=a%10; if(i%2==0) d+=i; else c*=i; }while(a>0,a/=10); cout<
720; 21
21; 720
15; 12
12; 15
124.Preprosessorning qaysi diretivasi matematik funksiyalar bilan ishlashin amalga oshiradi?
#include
#include
#include
#include
125.Dastur natijasini aniqlang:
main()
{int i=5,p=1;
while (i-1> p=p*i;
cout<<"i=”<< i<<”p=”<< p;}
i=0, p=24
i=1, p=120
i=1, p=24
i=24, p=1
126. Quyidagi ifodaning qiymati to’g’ri ko’rsatilgan javobni toping:
12>>3|6<<3^5+3
57
56
54
11
127.To’g’ri yozilgan operatorni toping: agar а ≤ b va с < 3 bo’lsa, u holda a= (с+b) bo’lsin.
if (a<=b) && (c< a=c+b;
if (a<=b & c< a=c+b;
if (a<=b !! c< a=c+b;
if ((a<=b) && c< a=c+b;
128. To'g'ri yozilgan operatorni ko'rsating:
if (x+y> s=(x+y)/2; else s=sqr(x*y);
if (x+y> s=(x+y)/2 else s=sqr(x*y);
if (x+y)>1 s=(x+y)/2; else s=sqr(x*y);
if x+y>1 s=(x+y)/2; else s=sqr(x*y);
129. Ifoda to’g’ri yozilgan satrni ko’rsating:
;
130. Dekrement amali nima?
Qiymatni 1 ga oshirish (a+=
Qiymatni 1 ga ko'paytirish (a*=
Qiymatni 1 ga kamytirish (a-=
Qiymat berish (a=
131. Dastur natijasini aniqlang:
m=0; i=1;
do { m=m+1/(2*i+1; i=i-1; } while (i>=0);
0.75;
0.2;
1.0;
1/3;
132. Inkrement amali nima?
Qiymatni 1 ga oshirish (a+=
Qiymatni 1 ga ko'paytirish (a*=
Qiymatni 1 ga kamytirish (a-=
Qiymat berish (a=
133. To’g’ri yozilgan operatorni toping: agar abc bo’lsa u holda har bir qiymatni uning kvadrati bilab almashtiring.
if (a>=b) && (b>=c) {a=a*a; b=b*b; c=c*c;}
if (a>=b || b>=c) {a=a*a; b=b*b; c=c*c;};
if (a>=b && b>=c) {a=a*a; b=b*b; c=c*c;}
if (a>=b & b>=c) {a=a*a; b=b*b; c=c*c;}
134. Quyida qaysi satrda mantiqiy operatorlar to’g’ri keltirilgan
&& - inkor, || -yoki, ! - va
&& - va, || -inkor, ! -yoki
&& - va, || -yoki, ! - inkor
&& - yoki, || -va, ! - inkor
135.C++ tilida ishlatiladigan asosiy matematik operatorlarni ko’rsating
Qo’shish (+), ayirish (-), ko’paytirish (*).
Qo’shish (+), ayirish (-), ko’paytirish (*), butun songa bo’lish (\) va modul bo’yicha bo’lish (%)(qoldiqni olish).
Qo’shish (+), ayirish (-), ko’paytirish (*), butun songa bo’lish (\).
Qo’shish (+), ayirish (-), ko’paytirish (*), butun songa bo’lish (\).
136. ........ algoritm chiziqli bo'ladi.
Tarkibida tarmoqlanish va takrorlanish bo'lmagan;
Hech qanday shart tekshirilmaydigan
Faqat bitta amalni ketma-ket takrorlaydigan;
Biror bir obyektning uzunligini hisoblaydigan;
137. Hisoblash natijasini aniqlang
{float a[5],b[5],s; int i,j; for(i=1; i<5; i=i+1) {s=0; a[i]=i+5; s=s+a[i]; } cout<
4
5
7
9
138.Hisoblash natijasini aniqlang
{float a[5],b[5],s; int i,j; for(i=1; i<5; i=i+2) {s=0; a[i]=i+5; s=s+a[i]; } cout<
4
7
8
9
139.Hisoblash natijasini aniqlang
{float a[5],b[5],s; int i,j; for(i=2; i<5; i=i+2) {s=0; a[i]=i+5; s=s+a[i]; } cout<
4
7
8
9
140. Dastur natijasi nimaga teng?
int main()
{ float x=3, y=2;
x=4*pow(y,2); y=2*sqrt(x)+2; x=2*y;
cout<getch();
return 0;
}
3 6 12
12 6 12
12 12 12
20 10 20
141.Dastur natijasi nimaga teng?
int main()
{ float x=3, y=2;
x=pow(y,2);y=sqrt(x)+2;x=2*y;
cout<return 0;
}
12 12 12
12 6 12
3 6 12
8 4 8
142.Dastur natijasini aniqlang:
int main(int argc, char *argv[])
{float s; int i;
s=0; i=3;
do {s=s+i; i=i-1;} while ( i<1 );
cout<return 0;
}
3
2
1
0.8
143.Dastur natijasini aniqlang:
int main(int argc, char *argv[])
{float s; int i;
s=0; i=5;
do {s=s+i; i=i-3;} while ( i<2 );
cout<return 0;
}
1
2
3
5
144.for (1; 2;3)uchun noto‘g‘ri tavsifni ko‘rsating
+2 - takrorlash sanagichi vazifasini bajaruvchio‘zgaruvchiga boshlang‘ich qiymat berishga xizmat qiladi
-2 - takrorlashni bajarish yoki yo‘qligini aniqlabberuvchi mantiqiy ifoda, agar shart rost bo‘lsa,takrorlash davom etadi, aks holda yo‘q
-3 - odatda takrorlash sanagichi qiymatini oshirish(kamaytirish) uchun xizmat qiladi yoki bu erda takrorlashshartiga ta’sir qiluvchi boshqa amallar bo‘lishi mumkin.
-1 - takrorlash sanagichi vazifasini bajaruvchi o‘zgaruvchiga boshlang‘ich qiymat berishga xizmat qiladi
145.Massiv elementlaridan foydalanish nima orqali bajariladi?
Vergul operatsiyasi orqali
Nuqta operatsiyasi orqali
Element ismi orqali
Element indeksi orqali
146.Massiv noto’g’ri ta’rifini ko’rsating.
int a[] = {1,2,3,4};
int a[2] = {1,2,3,4};
int a[20];
int a[4] = {1,2,3,4};
147.Kvadrat (n,n) matritsaning qaysi qismini berilgan fragment kodi to’ldiradi?
for(i=0; ifor(j=0; ja[i][j] = i+j+1;
asosiy diagonal elementlarini
asosiy diagonal ostidagi elementlarni
asosiy diagonal ustidagi elementlarni
qo’shimcha diagonal elementlari
148.Ekranga nima chiqadi?
#include
#include
int main ()
{
char a[] = “123”;
cout << strlen(a);
return 0;
}
6
5
4
3
149.Massiv – bu …
Elementlarning tartiblanmagan strukturasi
Elementlarning tartiblangan va tartiblanmagan strukturalari
2>1>0>0>0>0>
Do'stlaringiz bilan baham: |