A b c d kompilyatsiyadagi xatolik E`lon qilingach char a o`zgaruvchisining qaysi biri to`g`ri emas? A “3”


Download 79.17 Kb.
bet2/19
Sana27.03.2023
Hajmi79.17 Kb.
#1301029
1   2   3   4   5   6   7   8   9   ...   19
Bog'liq
DASTURLASH 1 baza @tatu1k

int p=1;

for(int i=0; i
{
P*=a[i];}
cout<<”answer : “<


  1. int sum=0;

for(int i=0; iif(a[i]<0)
{
sum+=a[i];}}
int sum=0;
for(int i=0; iif(a[i]>0){
sum+=a[i];}}

  1. if(!sum){

cout<<”sum= “<else{
cout<<”sum= “<

  1. int p=1;

for(int i=0; iif(i%2==1) p*=a[i];
}
cout<<”answer: “<

  1. Sikl operatori ko`rsartilgan to`g`ri qatorni belgilang

1.if then else
2.for(int i=1; i>a)
3.for(sikl parametri >:=; shart;)
4.for(;;) if(a<0) break; else{s+=a;
cin>>a;}
5.for(sikl parametri >:=) downto;
do
A)2,4 B)1,2 C)2,3 D)3,4
9. Quyidagi dastur natijasini aniqlang :
#include
int main(){
int x=0;
int y=0
if(x++ && y++){
y+=2;}
std::cout<return 0; }

  1. 1

  2. 2

  3. 4

  4. 3

10. Qaysi turdagi ma`lumotlare uzunligi 32 bitdan oshmaydigan haqiqiy sonlarni qabu qiladi?
A) float B) long C) long long D)double
11. Dastur bajarilishi natijasida ekranda qanday qiymat ko`rsatiladi?
char sim=’2’
switch(sim){
case’2’: cout<<”neud”;
case’3’: cout<<”undov”;
case’4’: cout<<”xor”;
case’5’: cout<<”otl”;
default: cout<<”oshibka vvoda”

  1. Neudundovxorotloshibkavvoda B)oshibka C)neud D)oshibka vvoda

12. Dastur bajarilgandan keyin nimaga teng?


k=1; while(k<10) k=k+k; cout<

  1. 16 B) 8 C) 4 D) 32

13. Dasturning bajarilishi natijasida ekranda qanday qiymat ko`rsatadi?
int x,y;
x=2
if(x=1) y=x+1;
else y=x-2;
cout<<”\n y=”<

  1. y=2 B)y=0 C)y=1 D)y=3

14. Matnli fayllar bilan ishlashda EOL tushunchasi bu nima?
A) qatorning oxiri
B)qatorning boshi
C)faylning oxiri
D) faylning boshi
15. Sikl tanasi necha marta bajarilishini aniqlang:
int i;
for(i=-7; i%3<-1; ++i)
{
……
}

  1. Bir marta ham bajarilmaydi

  2. 2

  3. Cheksiz sikl

  4. 7

16. Parametrli sikl operatori quyida berilgan qaysi
konstruksiyaga mos keladi?
A) for(ifoda_1; ifoda_shart; ifoda_2) {…}
B)do{…}while(ifoda_shart)
C)while(ifoda_shart){…}
D)if(ifoda_shart){…} else{…}
17. Ushbu kodni bajargandan song ozgaruvchining ekvivalenti nima?
Int a; for(a=0; a<10; a++){}
A)10 B)1 C)11 D)9

18. Quyidagi dastur natijasi aniqlang:


#include
using namespace std;
int main(){
char *s=”C++”;
cout<s++;
cout<return 0;}
A)C++ ++ B) C++ C) Kompilatsiyada hatolik D)C++ C++
19. Matn fayllar bilan ishlashda EOL tushunchasi bu nima?
A)qatorning oxiri B) qatorning boshi C) faylning oxiri D) faylning boshi
20. Qaysi funksiya matnli fayllar bilan ishlashda mavjud put(joylashtirish) pozitsiyasini ozgartirishga imkon beradi?
A)seekp() B)tellg() C)tellp() D)seekg()
21. Togri sintaksis qaysi javobda togri korsatilgan?
A) mytile.open(“misol.bin”), ios ::out);
B) open (“misol.bin”, ios:out);
C) myfile:: open (“misol.bin”, ios”::out);
D) myfile:: open(“misol.bin”, ios::out);
22. String dan char ga o’tish uchun …… funksiyalaridan foydalaniladi?
A)c_str() B)strcpy C)Assign D)B va C
23. Kod fragmentini bajargandan song x o’zgaruvchi qiymatini aniqlang:
int x=1, y=0;
while(y<12)
y=3*(++x)+1 ;


  1. Download 79.17 Kb.

    Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   19




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