Fayllar bilan ishlash oqimlariga qaysilar kiradi fstream, ifstream, ofstream


Download 0.67 Mb.
bet8/25
Sana23.11.2020
Hajmi0.67 Mb.
#150919
1   ...   4   5   6   7   8   9   10   11   ...   25
Bog'liq
AKT

A)Bahrom, Ilyos,Sodiq B)Bahrom Ilyos Sodiq *C)dasturda xatolik beradi

D) 3


34. C++ tili standarti bo’yicha indekslar soni nechtagacha bo’lishi mumkin?

A) 25 *B) 31 C) cheksiz D) 10

35. C++ tilida simvolli massivlar qanday e’lon qilinadi?

*A) char a[10] ; B) string h[5]; C) int a[9]; D) float a[5];

36. Noto’g’ri e’lon qilingan massivni toping?

A) int m[5] B) float a[5] C) bool b[9] D) Bu yerda barchasi to’g’ri

37. Massiv elementiga nima orqali murojaat qilinadi?

A) nomi orqali B) tipi orqali *C) indeksi orqali D) funksiya orqali

38. Quyidagi dastur bizga qanday natija beradi?

int a[5];

for (int i=0;i<5;i++)

{ cin>>a[i];}

cout<

A)kiritilgan elementlarning egallagan hotira hajmini

*B) elementlar sonini C) elementlarning o’rta arifmetigini

D) elementlar yig’indisini

39. Ikki o’lchamli dinamik massivni tashkil qilish to’g’ri ko’rsatilgan qatorni toping?

*A) int **a; B) int *a; C) int &&a; D) int &a;

40. Quyidagi funksiya qanday vazifani bajaradi?

a=new int*[satrlar soni];

A)Ko’rsatkich soniga qarab yangi massiv yaratadi.

B)Ko’rsatkichlarni qiymatini a ga tenglaydi

C)elementlarni qancha xotira egallaganini aniqlaydi

*D)Satrlar soniga qarab massivga dinamik xotira ajratadi

41. Dinanmik massivda satrlar xotirada qanday joylashadi?

A) ketma-ket *B) xotiraning turli qismida C) xotirada joy ajratilmaydi

42. Quyidagi dastur qanday natija chiqaradi?

int a[]={2,3,4,1};

sort(a,a+4);

for(int i=0;i<4;i++)

cout<

A)2,3,4,1 B)2,1 *C) 1,2,3,4 D) 4

43. Quyidagi dastur qanday natija chiqaradi?

float b[6];

b[0]=1;

b[1]=2;


b[2]=b[1]-1;

cout<


  1. 2 B) 6 *C) 1 D) 4

44. Quyidagi dastur qanday natija chiqaradi?

float b[6];

b[0]=1;

b[1]=2;


b[2]=b[1]-1;

cout<


  1. 2 *B) istalgan son chiqishi mumkin C) 0 D) dasturda xatolik chiqadi

45. Quyidagi dastur qanday natija chiqaradi?

int b[6]={1,2,3,4,5,6};

for (int i=0;i<6;i++)

{if(b[i]%2==0)

cout<

}


  1. 1 2 3 4 5 6 B) 1 3 5 C) 2 3 4 6 *D)2 4 6

46. Quyidagi dastur qanday natija chiqaradi?

int b[6]={1,2,3,4,5,6};

int m=b[0];

for (int i=0;i<6;i++)

{ if(b[i]

m=b[i];}


cout<*A) 1 B) 6 C) 2 D) 3

47. Quyidagi dastur qanday natija chiqaradi?

int b[6]={1,2,1,4,1,6};

int m=b[0],t=0;

for (int i=0;i<6;i++)

{ if(b[i]

m=b[i]; t=i}

cout<

A)1 *B) 0 C) 3 D) 5

48. Quyidagi dastur qanday natija chiqaradi?

int a[5][3]={2,2,2,3,3,3,2,1,1,4,4,3,1,2,3};

float s=0;

for (int i=0;i<5;i++)

{for(int j=0;j<3;j++)

{s=s+a[i][j];}

}

cout<


*A) 36 B) 15 C) 30 D)40

49. Quyidagi dastur qanday natija chiqaradi?

int a[3][3]={2,2,2,3,3,3,2,1,1};

for (int i=0;i<3;i++)

{for(int j=0;j<3;j++)

{ if(i==j) {cout<

}

}

A)Bosh diagonaldan tashqari barcha elementlarni



B) Bosh diagonaldan yuqori elementlarni

*C) Bosh diagonal elementlarini

D) Bosh diagonaldan pastki elementlarini

50. Massivlarni navlarga ajratish bu-….

A)Berilgan ma’lumotlarni yagona massivga yig’ish;

B)Berilgan ma’lumotlarni saralash;

C)Berilgan ma’lumotlarni boshqa tipga o’tkazish;

*D)Berilgan ko’plab obyektlarni biron-bir belgilangan tartibda qaytadan guruhlash


51.Dasturning natijasi qanday boladi?

#include

using namespace std;

int main()

{

short a,b;



double c;

a=3;


b=2;

c=a/b;


if (c==1)

{

cout << "yakuniy" << endl;



}

else


{

cout << "birinchi" << endl;

}

return 0;



}

*a) yakuniy

b) birinchi

c) dasturda xatolik bor

d) 1.5

52. Dasturning natijasi qanday boladi?



#include

using namespace std;

int main()

{

int a,b;



float c;

a=3;


b=2;

c=a/b;


switch (c)

{

case 1 : cout << "C++"; break;



case 1.5: cout << "Dastur"; break;

case 2 : cout << "Tugadi"; break;

case 2.5: cout << "Salom"; break;

}

return 0;



}

  1. Dastur

  2. C++

*c) Dasturda xatolik bor

  1. Tugadi

53. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a;


a=1500;

if (a%2==0)

{

a=a/100;


if (a/3==500)

{

if (a%4==3)



{

cout << "Talaba";

}

cout << "Salom";



}

cout << "Salom Talaba";

}

return 0;



}

  1. Talaba

*b) Salom Talaba

c) TalabaSalomSalom Talaba

d) SalomSalom Talaba

54. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b,c,d;



a=3;

b=2;


c=4;

d=a+b/2*c;

cout << d << endl;

return 0;

}

*a) 7


b) 0

c) 3


d) 0.625

55. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b,c;



double d;

a=3;


b=2;

c=4;


d=a+b/2*c;

cout << d << endl;

return 0;

}

*a) 7



b) 0

c) 3


d) 0.625

56. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b,c;



double d;

a=3;


b=2;

c=4;


d=b/c*sqrt(c)/pow(a,b);

cout << d << endl;

return 0;

}


  1. 0

  2. 0.(1)

  3. 2.25

*d) dasturda xatolik bor

57. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

double a,b,c,d;



a=3;

b=2;


c=4;

d=b/c*sqrt(c)/pow(a,b);

swap(a,d);

cout << d << endl;

return 0;

}


  1. 0

  2. 0.(1)

  3. 3

*d) dasturda xatolik bor

58. Dastur natijasi qanday boladi?

#include

#include

using namespace std;

int main()

{

int a,b,c;



double d;

a=0;


b=1;

c=4;


d=b/c*sqrt(c)/pow(a,b);

swap(a,d);

cout << d << endl;

return 0;

}


  1. 0

  2. 0.(1)

  3. 3

*d) dasturda xatolik bor

59. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b,c;



a=2;

b=0;


c=0;

bool e= a>=b && c<=b;

cout << a+e << endl;

return 0;

}

*a) 3


b) 2

c) 0


d) dasturda xatolik bor

60. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b,c;



a=3;

b=4;


c=8;

bool e= a>=b && c<=b;

if (e)

{

if (e%11==0)



{

if (a==3)

{

cout << "C++";



}

cout << "Dasturchi";

}

cout << "Dasturlash";



}

return 0;

}


  1. Dasturlash

  2. C++

*c) Ekranga xech narsa chiqmedi

d) Dasturda xatolik bor

61. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b,c;



a=3;

b=4;


c=8;

bool e= a<=b && c>=b;

if (e)

{

if (e%11==0)



{

if (a==3)

{

cout << "C++";



}

cout << "Dasturchi";

}

cout << "Dasturlash";



}

return 0;

}

*a) Dasturlash



  1. C++

c) Ekranga xech narsa chiqmedi

d) Dasturda xatolik bor

62. Dastur natijasi qanday boladi?

#include

#include

using namespace std;

int main()

{

int a,b,c;



double d;

a=0;


b=2;

c=1;


d=(a+b)/c+pow(b,a)/b;

cout << d << endl;

return 0;

}

*a) 2.5



b) 2

c) 0


d) dasturda xatolik bor

63. Dastur natijasi qanday boladi?

#include

#include

using namespace std;

int main()

{

int a,b,c;



double d;

a=0;


b=2;

c=1;


d=pow(a+(b+2*c)/2,2)/(a+2*b);

cout << d << endl;

return 0;

}


  1. 0

*b) 1

  1. 2

  2. Dasturda xatolik bor

64. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b,c;



a=4;

b=8;


c=0;

bool e= a>b || b>c;

cout << e << endl;

return 0;

}


  1. -1

  2. 0

*c) 1

  1. Dasturda xatolik bor

65. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

short d;


double a,b,c;

a=1.5;


b=3;

c=2.3;


d=a+b+c;

cout << d << endl;

return 0;

}


  1. 6.8

*b) 6

c) Ekranga xech nars chiqmedi

d) Dasturda xatolik bor

66. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

short a,b,c;



a=3.8;

b=2.2;


c=1.5;

if (b+c==3)

{

if (a+b==5)



{

if (a+c==4)

{

cout << "Dastur";



}

cout << "Darsi";

}

cout << "Tugadi";



}

return 0;

}


  1. Tugadi

  2. DarsiTugadi

*c) DasturDarsiTugadi

  1. Ekranga xech narsa chiqmedi

67. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

short a,b,c;



float d;

a=10;


b=3;

c=9;


d=(a+c+3*b)/a;

cout << d << endl;

return 0;

}

*a) 2



  1. 2.8

  2. 3

  3. Dasturda xatolik bor

68. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,c;


a=5;

c=a/4;


switch (c)

{

case 1:



case 3: cout << "Ishladi"; break;

case 5: cout << "Dastur"; break;

default: cout << "Talaba";

}

return 0;



}

*a) Ishladi

b) Dastur

c) Talaba

d) Ekranga xech narsa chiqmedi

69. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b,c;



a=5;

b=12;


c=b/a;

switch (c)

{

case 1:


case 3: cout << "Ishladi"; break;

case 5: cout << "Dastur"; break;

default: cout << "Talaba";

}

return 0;



}

a) Ishladi

b) Dastur

*c) Talaba

d) Ekranga xech narsa chiqmedi

70. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int q=0;



string s="murakkab dastur";

if (s[0]=='m')

{

q=q++;


}

cout << q++;

return 0;

}

*a) 0



b) 1

c) 2


d) dasturda xatolik bor

71. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b,q=0;



a=1.2;

b=2;


if (b+a==3)

{

if (a==2)



{

q=q++;


}

q++;


}

cout << q++;

return 0;

}


  1. 3

  2. 2

*c) 1

  1. 0

72. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

a=10;


b=2;

if (a/b==5)

{

if (a==10)



{

if (b==2)

{

cout << "Ortacha"; return 0;



}

cout << "Rost"; return 0;

}

cout << "Xato";



}

return 0;

}


  1. Ortacha

  2. Rost

  3. Xato

*d) Dasturda xatolik bor

73. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b,c;



a=10;

b=5;


c=7;

bool e = a>=b && c!=b || a<=c;

cout << e << endl;

return 0;

}


  1. -1

  2. 0

*c) 1

  1. Dasturda xatolik bor

74. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b;


a=10;

b=5;


bool e = a=cout << e << endl;

return 0;

}


  1. -1

  2. 0

  3. 1

*d) Dasturda xatolik bor

75. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a=0,b=0,c=1;



b+=a++;

b+=c;


cout << b++ << endl;

return 0;

}


  1. -1

  2. 0

*c) 1

  1. 2

76. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

string s="mustaqil ish";



int n=s.find(' ');

cout << n << endl;

return 0;

}

*a) 8



b) 7

c) 9


d) 0

77. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

string s="mustaqil ish";



int n=s.find(' ');

s.erase(n,s.size());

cout << s << endl;

return 0;

}


  1. mustaqil ish

*b) mustaqil

c) ish


d) dasturda xatolik bor

78. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

string s="mustaqil ish";



int n=s.find("mustaqil ish");

cout << n << endl;

return 0;

}

*a) 0



b) 12

c) 8


d) 1

79. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int n(2.8),b=12;



cout << b/n;

return 0;

}


  1. 4

*b) 6

c) 12


d) Dasturda xatolik bor

80. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

short s(500.500),a=10;



if (s>500)

{

s=10;



}

cout << s/a;

return 0;

}


  1. 50.05

  2. 1

*c) 50

d) dasturda xatolik bor

81. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

cout << sizeof(int)+sizeof(long) << endl;



return 0;

}

*a) 8



b) 4

c) 2


d) dasturda xatolik bor

82. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

string s="Yutqazdin";



int a;

a=sizeof(long long);

a+=s.size();

cout << a << endl;

return 0;

}


  1. 13

  2. 15

*c) 17

  1. Dasturda xatolik bor

83. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

string s="98";



int a=0;

a+=s[1]-48;

cout << a;

return 0;

}


  1. 98

  2. 89

  3. 9

*d) 8

84. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

string a,s="men dasturchi bolaman";



int n=s.find(' ');

s.erase(0,n+1);

n=s.find(' ');

a=s.substr(0,n);

cout << a << endl;

return 0;

}


  1. men dasturchi bolaman

  2. dasturchi bolaman

  3. men

*d) dasturchi

85. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

char a="men va sen";



int n = a.find(' ');

cout << n << endl;

return 0;

}


  1. 3

  2. 6

  3. 10

  4. Dasturda xatolik bor



  1. “++” ma’nosi nima?

a)Identifikatsiyalash. b) Provikatsiyalash *c) Inkrement d)Dikrement

87. Unsigned int ni qiymat chegarasi qanchadan qanchagacha?

a)-65535-65536 b)-32768-32768 *c)0-65535 d)0-32767

88.Void qancha joy egallaydi?

*a) 2 yoki 4 b) 4 yoki 8 c) 8 yoki 16 d) 1 yoki 2

89. Chala shart operatorini korsating.

*a) if (…) {…}

b) if (…) {…} else {…}

c) for (…;…;…)

d) while (…) {…}

90. Takrorlanuvchi operatorlarga misollar keltiring?

a)if , for ,while;

*b)for,do-while,while;

c)do-while,for,if,switch;

d)for,while,switch,goto;

91.Dasturning natijasi qanday boladi?

#include

using namespace std;

int main()

{

int q,e;



q=0;

e=0;


bool b, a = q == e;

b = a >=q;

cout << b+a;

return 0;

}

*a) 2


b) 1

c) dasturda xatolik bor

d) 0

92. Dasturning natijasi qanday boladi?



#include

using namespace std;

int main()

{

short a,b;



a=0;

b=9;


if (a=b-9)

{

cout << "Yakuniy";



}

else


{

cout << "Yakunlandi";

}

return 0;



}

  1. Yakuniy

  2. Dasturda xatolik bor

*c) Yakunlandi

  1. Ekanga xech narsa chiqmedi

93. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int n[]={0, 1.1, 2.2, 3.3, 5.5};



float x;

x=(n[1]+n[4])/n[2]+n[3];

cout << x;

return 0;

}


  1. 5

*b) 6

c) 5.5


d) 0

94. Dastur natijasi qanday boladi?

#include

#include

using namespace std;

int main()

{

int n[]={1, 5.5, -2, 3.3, 5.5};



float x;

x=(pow(n[2],2)+abs(n[3]))/(n[1]-n[3]);

cout << x;

return 0;

}

*a) 3.5


b) 3

c) -27


d) 13.5

95. Dastur natijasi qanday boladi?

#include

#include

using namespace std;

int main()

{

if (M_PI>3.14)



{

if (exp(1)<1)

{

if (M_PI_4>3)



{

cout << "Yomon"; return 0;

}

cout << "Yaxshi"; return 0;



}

cout << "Ortacha";

}

return 0;



}

*a) Ortacha

b) Yomon

c) Yaxshi

d) Ekranga xech narsa chiqmedi

96. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b;



a=2;

b=3;


cout << (a*b)*(1/b);

return 0;

}

*a) 0


  1. 2

  2. 1

d) dasturda xatolik bor

97. Dastur natijasi qanday boladi?

#include

#include

using namespace std;

int main()

{

int a,b;


a=2;

b=3;


cout << (a*b)*pow(b,-1);

return 0;

}


  1. 0

  2. 1

*c) 2

d) dasturda xatolik bor

98. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int a,b;


a=7;

b=4;


if (a*b%3==1)

{

if (a/b==1)



{

if (b/a>0)

{

cout << "Xayir"; return 0;



}

cout << "Tugadi"; return 0;

}

cout << "Dastur";



}

return 0;

}


  1. Xayir

  2. Dastur

*c) Tugadi

d) Dasturda xatolik bor

99. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

double a,b;



b=4.4;

a=b/2.2;


cout << b/a;

return 0;

}

*a) 2.2


b) 2

c) 1


d) dasturda xatolik bor

100. Dastur natijasi qanday boladi?

#include

using namespace std;

int main()

{

int b=20.5;



bool a = 20>=b;

if (a)


{

if (b<=b)

{

cout << "Bola"; return 0;



}

cout << "Bolalar"; return 0;

}

return 0;



}

*a) Bola


  1. Bolalar

c) Ekranga xech narsa chiqmedi

d) Dasturda xatolik bor



Download 0.67 Mb.

Do'stlaringiz bilan baham:
1   ...   4   5   6   7   8   9   10   11   ...   25




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