Fayllar bilan ishlash oqimlariga qaysilar kiradi fstream, ifstream, ofstream


Download 0.67 Mb.
bet22/25
Sana23.11.2020
Hajmi0.67 Mb.
#150919
1   ...   17   18   19   20   21   22   23   24   25
Bog'liq
AKT

#include

  • #include

  • #include

  • usingnamespace std;

  • int main()

  • {int a, b;

  • cin >>a>>b;

  • if(a<b) {cout<<"YES";}

  • else{k1:cout<<"NO";}

  • return0;

  • }

    a)YES

    b)no


    *c)NO

    d)dasturda xatolik bor

    5. a=98 b=97 bo`lgandagi dastur natijasini toping.


    1. #include

    2. #include

    3. usingnamespace std;

    4.  

    5. int main()

    6. {

    7. int a,b;

    8. cin>>a>>b;

    9. if(a>b)

    10. cout<<a;

    11. else

    12. cout<<a<<" "<<b;

    13. return0;

    14. }

    *a)98

    b)98 97


    c)9897

    d)97


    6. x=6 y=6 dagi chiquvchi natijani toping.

    1. #include

    2.  

    3. usingnamespace std;

    4.  

    5. int main()

    6. {double x, y;

    7. cin>>x>>y;

    8. if(x<=y){

    9. cout<<"0"<<" "<<y;}

    10. else{

    11. cout <<x<<" "<< y;}

    12. return0;

    13. }

    *a) 0 6

    b) 6 6


    c) 06

    d) 66


    7. int tipining qiymat oralig`ini toping.

    a) 0… 255

    b) 0… 232-1

    *c) -2147483648 … 2147483647

    d) 0… 256

    8. a=348 dagi chiquvchi qiymatini toping.



    #include

    using namespace std;

    int main()

    { int a;


    cin>>a;

    if(a%3==0)cout<<"bo`linadi";

    return 0;}


    a) qiymat chiqmaydi

    b) dastur xato

    *c) bo’linadi

    d) 348


    9. Kiritish oqimi qaysi?

    *a) istream

    b) ostream

    c) ifstream

    d) string.h

    10. a=467 dagi chiquvchi qiymatni toping.



    #include

    using namespace std;

    int main()

    { int a;


    cin>>a;

    if(a%7==0)

    cout<<"bo`linadi";

    else cout<<"qoldiq: "<

    return 0;

    }


    *a) qoldiq: 5

    b) bo’linadi

    c) qoldiq: 6

    d) bo’linadi qoldiq:

    11. Chiquvchi natijani toping (a=12)


    #include

    using namespace std;

    int main()

    { int a;


    cin>>a;

    if(a%7==0)

    cout<<"bo`linadi";

    else cout<<"qoldiq: "<

    return 0;

    }


    *a) qoldiq: 5

    b) bo’linadi

    c) qoldiq: 6

    d) bo’linadi qoldiq:

    12. a=456789 chiquvchi natijani toping


    #include

    using namespace std;

    int main()

    { double a;

    cin>>a;

    if(a%3987==0) cout<<"bo`linadi";



    else cout<<"qoldiq: "<

    return 0;}



    a) 147

    *b) dasturda xatolik bor

    c) 589

    d) 7


    13. Noto’g’risini toping

    a) int butun tip

    *b) bool haqiqiy tip

    c) unsigned tipida o`zgaruvchi nolga teng yoki kata bo`ladi

    d) o`zgaruvchi “int a;” kabi beriladi

    14. a=6 b=7 dagi chiquvchi qiymatni toping



    #include

    using namespace std;

    int main()

    { double a,b;

    cin>>a>>b;

    if(a>b)swap(a,b);

    cout<

    return 0;}



    a) 7

    b) 76


    c) 6

    *d) 67


    15. short tipining qiymat oralig`ini toping

    a) 0… 255

    *b) -32768 … 32767

    c) 0… 4294967295

    d) -263… 263-1

    16. long tipining qiymat oralig`ini toping

    a) 0… 255

    b) -32768… 32767

    c) 0… 4294967295

    *d) -263 … 263-1

    17. unsigned tipining qiymat oralig`ini toping

    a) 0… 255

    b) -32768… 32767

    *c) 0 … 4294967295

    d) -263… 263-1

    18. double tipining xotiradan egallagan joyi miqdori

    a) 6 bayt

    b) 10 bayt

    *c) 8 bayt

    d) 16 bayt

    19. float tipining xotiradan egallagan joyi miqdori

    *a) 4 bayt

    b) 10 bayt

    c) 8 bayt

    d) 16 bayt

    20. long double tipining xotiradan egallagan joyi miqdori

    a) 6 bayt

    b) 10 bayt

    c) 8 bayt

    *d) 12 bayt

    21. a=5 b=6 dagi chiquvchi qiymatni toping


    #include

    using namespace std;

    int main()

    { double a,b;

    cin>>a>>b;

    if(a>b)swap(a,b);

    else swap(a,b);

    cout<

    return 0;}


    *a) 6 5

    b)5 5


    c)55

    d)65


    22. a=5 b=6 dagi chiquvchi qiymatni toping

    #include

    using namespace std;

    int main()

    { double a,b;

    cin>>a>>b;

    if(a>b) goto k1;

    else swap(a,b);

    cout<

    return 0;}


    a)5 6

    b)6 5


    *c) dastur xato

    d)cheksiz davom etadi

    23. a=6 b=7 s=8 dagi chiquvchi natijani toping


    1. #include

    2. usingnamespace std;

    3. int main

    4. {int a,b,s;

    5. cin>>a>>b>>s;

    6. if(a>0)a=a*a;

    7. if(b>0)b=b*b;

    8. if(s>0)s=s*s;

    9. cout<<a<<" "<<b<<" "<<s;

    10. return0;

    11. }

    *a) dasturda xatolik bor

    b)6 7 8

    c)36 49 64

    d)678


    24. a=1 b=2 c=3 d=4 dagi natijani toping

    1. #include

    2. #include



    3. int main()

    4. {float a,b,c,d,g,s;

    5. cin>>a>>b>>c>>d;

    6. if(a>=b&&a>=c&&a>=d){s=a;}

    7. if(b>=a&&b>=c&&b>=d){s=b;}

    8. if(c>=b&&c>=a&&c>=d){s=c;}

    9. if(d>=b&&d>=c&&d>=a){s=d;}

    10. if(a<=b&&a<=c&&a<=d){g=a;}

    11. if(b<=a&&b<=c&&b<=d){g=b;}

    12. if(c<=b&&c<=a&&c<=d){g=c;}

    13. if(d<=b&&d<=c&&d<=a){g=d;};

    14. d= a<=b&&b<=c&&c<=d? s:g;

    15. cout <<d<<" "<<d<<" "<<d<<" "<<d;

    16. return0;

    17. }

    *a) dastur xato

    b)4 4 4

    c)444

    d)1 2 3 4



    25. To’la shartli operator qaysi?

    *a) if (…){….} else {….}

    b)if(…){…}

    c)else{….}

    d)barcha if(…) qatnashgan operatorlar

    26. x=0.7 y=0 dagi natijani toping



    #include

    #include

    #include

    usingnamespace std;

    int main()

    {float x,y;

    cin >>x>>y;

    if((x*x+y*y)<=1)

    {cout <<"yes";}

    else{cout<<"no";}

    return0;}

    a)no


    *b) yes

    c)0.7 0


    d)0.70

    27. x=0.4 y=1.68 dagi natijani toping



    1. #include

    2. #include

    3. usingnamespace std;

    4.  

    5. int main()

    6. {float x,y;

    7. cin>>x>>y;

    8. if(x<=1&&y<=1&&x>=-1&&y>=-1){cout<<"yes";}

    9. else{cout<<"no";}



    10. return0;

    11. }

    a)yes

    b)0.4


    c)1,68

    *d) no


    28. shartsiz o`tish operatori to`g`ri qo`llangan qatorni toping

    a)k1:goto;

    b)go to;

    c)goto;


    *d) goto k1;

    29. a=7 b=9 dagi qiymatini toping



    #include

    using namespace std;

    int main()

    { int a,b;

    cin>>a>>b;

    if(b

    cout<

    return 0;}



    *a) 7

    b)9


    c)8

    d)10


    30.x=2 y=4 z=3 natija qanday bo`ladi.

    1. #include

    2. #include

    3. #include

    4. usingnamespace std;

    5. int main()

    6. {double x,y,z,k;

    7. cin>>x>>y>>z;

    8. if((x+y)>z&&(x+z)>y&&(z+y)>x){cout<<"YES";}else{cout<<"NO";}

    9. return0;} 

    a)NO

    *b) YES


    c)234

    d)yesno


    31. variant tanlash operatori qaysi

    a)for


    b)if

    c)else


    *d) switch

    32. Takrorlanuvchi operatorlar qaysilar

    a)switch, if

    *b) for, while, do-while

    c)int, char

    d)void, fact, endl

    33. x=0.6 y=0.5 natijani toping


    1. #include

    2. #include

    3. #include

    4. usingnamespace std;

    5.  

    6. int main()

    7. {

    8. float x,y;

    9. cin >>x>>y;

    10. if((x*x+y*y)<=1&&(x*x+y*y)>=0.25)

    11. {cout <<"yes";}

    12. else{cout<<"no";}

    13. return0;

    14. }

    a)yes

    b)0.50.6


    c)0.6

    *d) no


    34. n=2 dagi natijani toping

    #include

    using namespace std;

    int main()

    { int n;cin>>n;

    for(int i=1;i<=n;i++)cout<<"Salom";

    return 0;}



    *a) SalomSalom

    b)Salom


    c)salom

    d)salomsalom

    35. n=7 natijani toping


    #include

    using namespace std;

    int main()

    { int n,c=0;

    cin>>n;

    for(int i=1;i<=n;i++)c=c+1;



    cout<

    return 0;}



    a)6

    b)8


    c)0

    *d) 7


    36. Variant tanlash operatorida berilgan variantlardan tashqari nazarda tutilmagan variantlar uchun …….. ishlatiladi.

    *a) default

    b)case

    c)break


    d)else

    37. Variant tanlash operatorida variantlar qanday operator bilan beriladi

    a)break

    *b) case


    c)if

    d)else


    38. Variant qatorini tugatib beruvchi operator

    a)switch


    b)goto

    *c) break

    d)case

    39. Sharti keyin beriluvchi takrorlanuvchi operator too`g`ri berilgan qatorni toping



    a)while(….){……….}

    b)do{………….}while

    c)for(…..) {…………}

    *d) do{…….}while(…)

    40. Sharti oldin beriluvchi takrorlanuvchi operator too`g`ri berilgan qatorni toping

    a) while(….){……….}

    b)do{………….}while

    c)for(…..) {…………}

    d)do{…….}while(…)

    41. n=3 natijani toping



    #include

    using namespace std;

    int main()

    { int n;


    cin>>n;

    switch(n)

    {

    case 1: case 2:



    case 3: case 4: cout<<"ok"; break;}

    return 0;}



    *a) ok

    b)Ok


    c)3

    d)case:3


    42. Bir xil hisoblash jarayonining bir necha bor takrorlanishi

    a)goto


    *b) sikl

    c)tarmoqlanuvchi

    d)grafik

    43. for(int i=1; i<=n; i++) bu holatda i<=n qismi qanday nomlanadi

    a)ilova

    b)majburiy to`xtatish belgisi



    *c) sikl takrorlanish sharti

    d)sikl parametrini oshirish

    44. for(int i=1; i<=n; i++) bu holatda i++ qismi qanday nomlanadi

    a)ilova


    b)majburiy to`xtatish belgisi

    c) sikl takrorlanish sharti

    *d)sikl parametrini oshirish

    45. for(int i=1; i<=n; i++) bu holatda 1 qanday nomlanadi

    a)ilova

    *b) sikl parametrining boshlang`ich qiymati



    c) sikl takrorlanish sharti

    d)sikl parametrini oshirish

    46. a=5 b=6 natijani toping


    #include

    using namespace std;

    int main()

    { int a,b,c;

    cin>>a>>b;

    c= a>b?a:b;

    cout<

    return 0;}



    *a) 6

    b)5


    c)9

    d)11


    47. a=5 n=6 natijani toping

    #include

    #include

    using namespace std;

    int main()

    { double a,n;

    cin>>a>>n;

    for(int i=1; i<=n; i++)a=a+1;

    cout<


    return 0;}

    a)12

    b)10


    *c) 11

    d)121


    48. a=79 b=99 natijani toping

    #include

    using namespace std;

    int main()

    { int a,b, m;

    cin>>a>>b;

    if(a>b){m=a;}

    else{m=b;}

    cout<


    return 0;}

    *a) 99

    b)79


    c)178

    d)7999


    49.a=6 b=4 natijani toping

    #include

    #include

    using namespace std;

    int main()

    { int a,b, m;

    cin>>a>>b;

    if(a!=b){m=a*a;}

    else{m=b;}

    cout<

    return 0;}



    a)6

    *b)36


    c) 4

    d) 64


    50. a=5 b=9 bo’lsa dastur natijani toping

    #include

    #include

    using namespace std;

    int main()

    { int a,b, k;

    cin>>a>>b;

    if(a==b){k=a*a+b*b;}

    else{k=0;}

    cout<

    return 0;}



    *a) 0

    b)5


    c)136

    d)59


    51. a=4 b=8 dagi natijani toping

    #include

    #include

    using namespace std;

    int main()

    { int a,b, k=0;

    cin>>a>>b;

    while(a<=b){

    k+=a; a++;

    }

    cout<


    return 0;}

    a)12

    *b) 30


    c)45

    d)15


    52. a=4 b=8 dagi natijani toping

    #include

    #include

    using namespace std;

    int main()

    { int a,b, k=0;

    cin>>a>>b;

    do{ k+=a; a++;

    } while(a<=b)

    cout<

    return 0;}



    a)12

    *b) 30


    c)45

    d)15


    53. a=1 b=1 s=2 dagi chiquvchi natijani toping

    #include

    usingnamespace std;

    int main()

    {int a,b,s;

    cin>>a>>b>>s;

    if(a>0){a=a*a;

    b=-b;

    s=-s;}

    cout<<a<<" "<<b<<" "<<s;

    return0;

    }

    a)1-1-2


    b)112

    *c) 1 -1 -2

    d)1 1 2

    54.a=4 b=4 natijani toping



    #include

    #include

    using namespace std;

    int main()

    { int a,b, k=0;

    cin>>a>>b;

    for(int i=1; i<=a; i++){k+=b;}

    cout<


    return 0;}

    *a) 16

    b) 43


    c)56

    d)90


    55. a=98765 natijani toping

    #include

    #include

    using namespace std;

    int main()

    { int a;

    cin>>a;


    if(a%2==0)cout<<"juft";

    else cout<<"toq";

    return 0;}


    a) juft

    b) 98765


    *c) toq

    d) 2


    56. a=5 natijani chiqaring

    #include

    #include

    using namespace std;

    int main()

    { int a;

    cin>>a;


    if(a>0)cout<<99999;

    if(a<0)cout<<33333;

    if(a==0)cout<<00000;

    return 0;}



    a) 33333

    *b)99999


    c)00000

    d)Nan


    57. a=5 natijani chiqaring

    #include
    using namespace std;

    int main()

    { int a;

    cin>>a;


    for(int k=1; k<=a; k++)cout<<"o ";

    return 0;}



    a)12345

    b)5


    c)ooooo

    *d) o o o o o

    58. a=3 dastur natijasini toping


    #include
    using namespace std;

    int main()

    { int a;

    cin>>a;


    for(int k=1; k<=a; k++){cout<<"o ";goto k1;}

    k1: return 0;}



    a) o o o

    *b) o


    c)3

    d)ooo


    59. a=70 natijani toping

    #include
    using namespace std;

    int main()

    { int a;

    cin>>a;


    if(a%2==0){

    if(a%5==0){cout<

    else{cout<

    }else{cout<

    return 0;}


    a)70

    *b) 14


    c)35

    d)703514


    60. a=56 natijani toping

    #include
    using namespace std;

    int main()

    { int a;

    cin>>a;


    if(a%3==0){cout<<"3 ga bo`linadi";}

    else{cout<

    return 0;}


    *a) 56

    b)3 ga bo`linadi

    c)56 3 ga bo`linadi

    d)Nan


    61. a=63 natijani toping

    #include
    using namespace std;

    int main()

    { int a;

    cin>>a;


    if(a%7==0){cout<<"7 ga bo`linadi";}

    else{cout<

    return 0;}


    *a) 56

    b)7 ga bo`linadi

    c)56 7 ga bo`linadi

    d)Nan


    62. a=35 natijani toping

    #include
    using namespace std;

    int main()

    { int a;

    cin>>a;


    if(a%2==0){

    if(a%5==0){cout<

    else{cout<

    }else{cout<

    return 0;}


    a)70

    b) 14


    *c)35

    d)703514


    63. 58. a=2 dastur natijasini toping

    #include
    using namespace std;

    int main()

    { int a;

    cin>>a;


    for(int k=1; k<=a; k++){cout<<"o ";goto k1;}

    k1: return 0;}



    a) o o

    *b) o


    c)2

    d)oo


    64. a=3 natijani chiqaring

    #include
    using namespace std;

    int main()

    { int a;

    cin>>a;


    for(int k=1; k<=a; k++)cout<<"a ";

    return 0;}



    a)123

    b)3


    c)aaa

    *d) a a a

    65. a=5 b=5 natijani toping


    #include

    #include

    using namespace std;

    int main()

    { int a,b, k;

    cin>>a>>b;

    if(a!=b){k=a*a+b*b;}

    else{k=0;}

    cout<

    return 0;}



    *a) 0

    b)5


    c)41

    d)55


    66. a=0 b=6 natijani toping

    #include

    #include

    using namespace std;

    int main()

    { int a,b, m;

    cin>>a>>b;

    if(a!=b&&a!=0){m=a;}

    else{m=b;}

    cout<

    return 0;}



    a)8

    b)80


    c)0

    *d) 6


    67. a=8 b=8 natijani toping

    #include

    #include

    using namespace std;

    int main()

    { int a,b, m;

    cin>>a>>b;

    if(a!=b){m=a*a;}

    else{m=b;}

    cout<

    return 0;}



    *a) 8

    b)36


    c) 4

    d) 64


    68. a=99 b=99 natijani toping

    #include

    using namespace std;

    int main()

    { int a,b, m;

    cin>>a>>b;

    if(a>b){m=a;}

    else{m=b;}

    cout<


    return 0;}

    *a) 99

    b)9


    c)9999

    d)0


    69. a=8 n=6 natijani toping

    #include

    using namespace std;


    { double a,n;

    cin>>a>>n;

    for(int i=1; i<=n; i++)a=a+1;

    cout<


    return 0;}

    a)13

    b)14


    c) 18

    *d) dastur xato

    70. a=8 b=9 natijani toping


    #include

    using namespace std;

    int main()

    { int a,b,c;

    cin>>a>>b;

    c= a

    cout<

    return 0;}



    *a) 8

    b)89


    c)9

    d)117


    71. n=8 natijani toping

    #include

    using namespace std;

    int main()

    { int n;


    cin>>n;

    switch(n)

    {

    case 1: case 2:



    case 3: case 4: cout<<"ok"; break;}

    return 0;}



    a) ok

    b)Ok


    *c) natija chiqmaydi

    d)case:3


    72. x=3 y=4 z=3 natija qanday bo`ladi.

    1. #include

    2. #include

    3. #include

    4. usingnamespace std;

    5. int main()

    6. {double x,y,z,k;

    7. cin>>x>>y>>z;

    8. if((x+y)>z&&(x+z)>y&&(z+y)>x){cout<<"YES";}else{cout<<"NO";}

    9. return0;} 

    a)NO

    *b) YES


    c)334

    d)yesno


    73. a=7 b=9 dagi qiymatini toping

    #include

    using namespace std;

    int main()

    { int a,b;

    cin>>a>>b;

    if(b

    cout<

    return 0;}



    *a) 7

    b)9


    c)8

    d)10


    74. a=0 b=-4 dagi natijasini toping.

    #include

    #include

    #include

    usingnamespace std;

    int main()

    {int a, b;

    cin >>a>>b;

    if(a<b) {cout<<"YES";}

    else{k1:cout<<"NO";}

    return0;

    }

    a)YES


    b)no

    *c)NO


    d)dasturda xatolik bor

    75. a=98 b=97 bo`lgandagi dastur natijasini toping.



    #include

    #include

    usingnamespace std;

     

    int main()



    {

    int a,b;

    cin>>a>>b;

    if(a<b)

    cout<<a;

    else

    cout<<a<<" "<<b;

    return0;

    }

    a)98


    *b)98 97

    c)9897


    d)97

    76. x=5 y=6 dagi chiquvchi natijani toping.



    #include

    usingnamespace std;

     

    int main()



    {double x, y;

    cin>>x>>y;

    if(x<=y){

    cout<<"0"<<" "<<y;}

    else{

    cout <<x<<" "<< y;}

    return0;

    }

    *a) 0 6


    b) 5 6

    c) 06


    d) 56

    77. a=341 dagi chiquvchi qiymatini toping.



    #include

    using namespace std;

    int main()

    { int a;


    cin>>a;

    if(a%3==0)cout<<"bo`linadi";

    return 0;}


    *a) qiymat chiqmaydi

    b) dastur xato

    c) bo’linadi

    d) 341


    78. a=467 dagi chiquvchi qiymatni toping.

    #include

    using namespace std;

    int main()

    { int a;


    cin>>a;

    if(a%7=0)

    cout<<"bo`linadi";

    else cout<<"qoldiq: "<

    return 0;

    }


    a) qoldiq: 5

    b) bo’linadi

    *c) dasturda xatolik bor

    d) bo’linadi qoldiq:

    79. a=66 b=7 dagi chiquvchi qiymatni toping


    #include

    using namespace std;

    int main()

    { double a,b;

    cin>>a>>b;

    if(a>b)swap(a,b);

    cout<

    return 0;}



    a) 677

    b) 76


    *c) 766

    d) 667


    80. a=9 b=6 dagi chiquvchi qiymatni toping

    #include

    using namespace std;

    int main()

    { double a,b;

    cin>>a>>b;

    if(a>b)swap(a,b);

    else swap(a,b);

    cout<

    return 0;}


    *a) 6 9

    b)9 6


    c)96

    d)69


    81. a=2 b=3 s=4 dagi chiquvchi natijani toping

    1. #include

    2. usingnamespace std;

    3. int main

    4. {int a,b,s;

    5. cin>>a>>b>>s;

    6. if(a>0)a=a*a;

    7. if(b>0)b=b*b;

    8. if(s>0)s=s*s;

    9. cout<<a<<" "<<b<<" "<<s;

    10. return0;

    11. }

    *a) dasturda xatolik bor

    b)234


    c)2 3 4

    d)4 9 16


    82. a=1 b=2 c=3 d=4 dagi natijani toping

    #include

    #include

    int main()

    {float a,b,c,d,g,s;

    cin>>a>>b>>c>>d;

    if(a>=b&&a>=c&&a>=d){s=a;}

    if(b>=a&&b>=c&&b>=d){s=b;}

    if(c>=b&&c>=a&&c>=d){s=c;}

    if(d>=b&&d>=c&&d>=a){s=d;}

    if(a<=b&&a<=c&&a<=d){g=a;}

    if(b<=a&&b<=c&&b<=d){g=b;}

    if(c<=b&&c<=a&&c<=d){g=c;}

    if(d<=b&&d<=c&&d<=a){g=d;};

    d= a<=b&&b<=c&&c<=d? s:g;

    cout <<d<<" "<<d<<" "<<d<<" "<<d;

    return0;

    }

    *a) dastur xato

    b)4 4 4

    c)444


    d)1 2 3 4

    83. x=0.7 y=0.9 dagi natijani toping



    1. #include

    2. #include

    3. #include

    4. usingnamespace std;

    5. int main()

    6. {float x,y;

    7. cin >>x>>y;

    8. if((x*x+y*y)<=1)

    9. {cout <<"yes";}



    10. else{cout<<"no";}

    11. return0;

    12. }

    *a) no

    b)yes


    c)0.7 0.8

    d)0.70.8


    84. shartsiz o`tish operatori to`g`ri qo`llangan qatorni toping

    a)k1:goto;

    *b) goto k1;

    c)goto;


    d) go to;

    85. if va if-else boshqaruv elementlarida shartsiz o`tish operatori ham ishlatiladi, u …

    a)time

    b)switch


    *c) goto

    d)for


    86. a=8 b=15 dagi qiymatini toping

    #include

    using namespace std;

    int main()

    { int a,b;

    cin>>a>>b;

    if(b

    cout<

    return 0;}



    *a) 8

    b)15


    c)9

    d)16


    87. n=3 dagi natijani toping

    #include

    using namespace std;

    int main()

    { int n;cin>>n;

    for(int i=1;i<=n;i++)cout<<"Salom";

    return 0;}



    *a) SalomSalomSalom

    b)SalomSalom

    c)salom

    d)salomsalomsalom



    88. n=5 natijani toping

    #include

    using namespace std;

    int main()

    { int n;


    cin>>n;

    switch(n)

    {

    case 1: case 2:



    case 3: case 4: cout<<"ok"; break;}

    return 0;}



    *a) ok

    b)Ok


    c)5

    d)case:5


    89. a=10 b=6 natijani toping

    #include

    using namespace std;

    int main()

    { int a,b,c;

    cin>>a>>b;

    c= a>b?a:b;

    cout<

    return 0;}



    *a) 10

    b)6


    c)9

    d)11


    90. 47. a=6 n=6 natijani toping

    #include

    #include

    using namespace std;

    int main()

    { double a,n;

    cin>>a>>n;

    for(int i=1; i<=n; i++)a=a+1;

    cout<


    return 0;}

    a)11

    b)13


    *c) 12

    d)10


    91. 48. a=79 b=99 natijani toping

    #include

    using namespace std;

    int main()

    { int a,b, m;

    cin<

    if(a>b){m=a;}

    else{m=b;}

    cout<


    return 0;}

    *a) dastur xato

    b)79


    c)178

    d)7999


    92. a=98 b=97 bo`lgandagi dastur natijasini toping.

    #include

    #include

    usingnamespace std;

     

    int main()



    {

    int a,b;

    cin<<a<<b;

    if(a<b)

    cout<<a;

    else

    cout<<a<<" "<<b;

    return0;

    }

    a)98


    b)98 97

    *c) dastur xato

    d)97

    93. a=9 b=4 natijani toping



    #include

    #include

    using namespace std;

    int main()

    { int a,b, m;

    cin>>a>>b;

    if(a!=b){m=a*a;}

    else{m=b;}

    cout<

    return 0;}



    a)9

    b)81


    *c) 4

    d) 64


    94. a=8 b=8 natijani toping

    #include

    #include

    using namespace std;

    int main()

    { int a,b, m;

    cin>>a>>b;

    if(a!=b&&a!=0){m=a;}

    else{m=b;}

    cout<

    return 0;}



    *a) 8

    b)80


    c)0

    d)88


    95. a=5 b=4 bo’lsa dastur natijani toping

    #include

    #include

    using namespace std;

    int main()

    { int a,b, k;

    cin>>a>>b;

    if(a!=b){k=a*a+b*b;}

    else{k=0;}

    cout<

    return 0;}



    a) 0

    b)5


    *c) 41

    d)4


    96. a=8 b=8 dagi natijani toping

    #include

    #include

    using namespace std;

    int main()

    { int a,b, k=0;

    cin>>a>>b;

    while(a<=b){

    k+=a; a++;

    }

    cout<


    return 0;}

    *a)8

    b) 30


    c)45

    d)15


    97. a=2 b=2 s=2 dagi chiquvchi natijani toping

    #include

    usingnamespace std;

    int main()

    {int a,b,s;

    cin>>a>>b>>s;

    if(a>0){a=a*a;

    b=-b;

    s=-s;}

    cout<<a<<" "<<b<<" "<<s;

    return0;

    }

    a)4-2-2


    b)112

    *c) 4 -2 -2

    d)1 1 2

    98. a=3 b=3 natijani toping



    #include

    #include

    using namespace std;

    int main()

    { int a,b, k=0;

    cin>>a>>b;

    for(int i=1; i<=a; i++){k+=b;}

    cout<


    return 0;}

    *a) 9

    b) 43


    c)56

    d)90


    99. a=2 natijani toping

    #include

    #include

    using namespace std;

    int main()

    { int a;

    cin>>a;


    if(a%2==0)cout<<"juft";

    else cout<<"toq";

    return 0;}


    *a) juft

    b) 98765


    c) toq

    d) 2


    100. a=-5 natijani chiqaring

    #include

    #include

    using namespace std;

    int main()

    { int a;

    cin>>a;


    if(a>0)cout<<99999;

    if(a<0)cout<<33333;

    if(a==0)cout<<00000;

    return 0;}



    *a) -33333

    b)99999


    c)00000

    d)Nan



    1. Jumlani yakunlang: “C++ tili satrlarni yaratish va ularni boshqarish uchun …… klassini ishlatadi.”

    A. standart char B. *standart satr



    1. cinget D. endl

    2. Quyidagi dastur natijasida ekranga nima chiqadi?



    string s1(“Tosh"), s2(“baqa");

    cout<< s1 + s2;

    1. xatolik sodir bo’ladi

    2. s1s2

    3. s1+s2

    4. *Toshbaqa

    3. Quyidagi dastur natijasida ekranga nima chiqadi?

    string s1="salom", s2="Salom";

    s1>s2?cout<


    1. Salom

    2. *salom

    3. s1

    4. s2

    4. Quyidagi dastur natijasida ekranga nima chiqadi?

    string s("Nilufar suvda o'sadi");

    s.insert(8, "guli ");

    cout<


    1. Nilufar suvda o'sadi

    2. Nilufar gulisuvda o'sadi

    3. *Nilufar guli suvda o'sadi

    4. guli Nilufar suvda o'sadi

    5. Quyidagi dastur natijasida ekranga nima chiqadi?

    string s("Birdan ikki keladi");

    s.insert(7, "keyin");

    cout<


    1. Birdan keyin ikki keladi

    2. Birdan ikki keladi

    3. *Birdan keyinikki keladi

    4. Birdan ikki keladi keyin

    6. Quyidagi dastur natijasida ekranga nima chiqadi?

    string s("Nilufar guli suvda o'sadi");

    s.erase(11);

    cout<


    1. Nilufar guli suvda

    2. Nilufar guli

    3. *Nilufar gul

    4. (Bo’sh ekran chiqadi)

    7. Quyidagi dastur natijasida ekranga nima chiqadi?

    string s1("Nilufar guli suvda o'sadi!"),

    s2("chiroyli gul?");

    s1.replace(12, 13, s2, 0, 12);cout<


    1. Nilufar guli suvda o'sadi chiroyli gul?

    2. Nilufar guli chiroyli gul!

    3. Nilufar guli chiroyli gul?

    4. *Nilufar gulichiroyli gul!

    8. Quyidagi dastur natijasida ekranga nima chiqadi?

    string youth("Nilufar guli suvda o'sadi!");

    int qidir = youth.find("suv");

    cout<


    1. 12

    2. *13

    3. 14

    4. -1

    9. Quyidagi dastur natijasida ekranga nima chiqadi?

    string youth("Bahor qishdan keyin keladi!!");

    int qidir = youth.find("kein");

    cout<


    1. 13

    2. 14

    3. 15

    4. *-1

    10. Funksiya ichida e’lon qilingan o‘zgaruvchilarga qanday o‘zgaruvchilar deyiladi?



    1. *lokal

    2. global

    3. extern

    4. register

    11. Global o‘zgaruvchilarning amal qilish doirasini ko’rsating:



    1. *Dastur oxirigacha amal qiladi

    2. Blok ichida amal qiladi

    3. Funksiya ichida amal qiladi

    4. Boshqa dasturlarda ham amal qiladi

    12. Funksiya parametrlari bilan biror amal bajarib, yangi parametrlar bilan huddi shunday amal bajariladigan bo’lsa qanday funksiyalardan foydalanamiz?



    1. Formal funksiyadan

    2. Funksiyani qayta yuklanshidan

    3. *Rekursiadan

    4. Parametrsiz funksiyadan

    13. Funksiyaga kirilganda o’zgaruvchilar avtomatik tarzda yaratilib, funksiyadan chiqishda ular o’chiriladigan hotira sinfi spetsifikatorini ko’rsating



    1. Extern

    2. Static

    3. *Auto

    4. Register

    14. Qaysi hotira sinfi o’zgaruvchisiga ko’rsatkich sifatida manzildan olish amalini qo’llab bo’lmaydi?



    1. Extern

    2. *Register

    3. Static

    D. Auto

    15. Dastur kompilyatsiya qilinganda qanday natija qaytaradi?

    #include

    int Funk( ) {

    static int a;

    a++;


    return a; }

    int main( ) {

    printf ("%d\n", Funk( )++); }


    1. 0

    2. 1

    3. 2

    4. *Kompilyatsiya jarayonida xatolik sodir bo’ladi

    16. Dastur kompilyatsiya qilinganda qanday natija qaytaradi?

    #include

    int Global=15;

    int main( ) {

    int Global = 40;

    printf("%d", ::Global); }


    1. 0

    2. *15

    3. 40

    4. Kompilyatsiya jarayonida xatolik sodir bo’ladi

    17. Dastur kompilyatsiya qilinganda qanday natija qaytaradi?

    #include

    int a=8;


    int main( ) {

    int a ++ = 2;

    a ++;

    printf ( "%d", ::a ); }



    1. 8

    2. 4

    3. 5

    D.*Kompilyatsiya jarayonida xatolik sodir bo’ladi
    18. Dastur kodlarini mantiqiy guruhga birlashtrish uchun ishlatilib dasturga bir necha kutubxonalar chaqirilganda nomlar orasida o’zaro nizo kelib chiqishini oldini olsh nima deyiladi?

    1. *Nomlar fazosi

    2. O’zgaruvchilar identifikatsiyasi

    3. Identifikatorlarni e’lon qilish

    4. Hotira sinflarining spetsifikatorlari

    19. Dastur kompilyatsiya qilinganda qanday natija qaytaradi?

    #include

    using namespace std;

    namespace foo {

    int a=2; int b=4; }

    int main () {

    using foo::b;

    b=5;

    cout<

    return 0;}


    1. 4

    2. *5

    3. 6

    4. 2

    20. Dastur kompilyatsiya qilinganda qanday natija qaytaradi?

    #include

    namespace abc

    { int foo = 0; }

    void func( )

    { using namespace abc;

    std::cout<< foo++; }

    int main( ){

    abc::foo=2;

    func( );

    return 0;}



    1. 0

    2. *2

    3. 3

    4. Kompilyatsiya jarayonida xatolik sodir bo’ladi



    Download 0.67 Mb.

    Do'stlaringiz bilan baham:
  • 1   ...   17   18   19   20   21   22   23   24   25




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