60
22
№152 Fan bobi – 1; Fan bo`limi – 3; Qiyinlik darajasi – 2;
Quyidagi dastur qismi ishlashi natijasida ekranga nima chiqadi?
int a[]={-20,30,-40,43,64}; int s=6; for (int i=0;i<5;i++) if (a[i]<0) s=s+a[i]; cout<
-54
60
-60
-24
№153 Fan bobi – 2; Fan bo`limi – 2; Qiyinlik darajasi – 3;
Quyidagi dastur qismi ishlashi natijasida ekranga nima chiqadi?
int a[]={-20,30,-40,43,64}; int s=0; for (int i=0;i<5;i++) if (a[i]<0) s=s+a[0]; cout << s;
-40
-20
-60
40
№154 Fan bobi – 1; Fan bo`limi – 3; Qiyinlik darajasi – 2;
Quyidagi dastur qismi ishlashi natijasida ekranga nima chiqadi?
int a[]={-20,30,-40,43,64}; int s=0; for (int i=0;i<3;i++) if (a[i]>0) s=s+a[i]; s=s+a[2]; cout
<< s;
-10
30
-70
40
№155 Fan bobi – 2; Fan bo`limi – 1; Qiyinlik darajasi – 2;
Quyidagi dastur qismi ishlashi natijasida ekranga nima chiqadi?
double a[]={2.5, 3.9, 4.8, 6.2}; int s=0; for (int i=0;i<4;i++) s=s+a[i]; cout << s;
15
17.4
16.4
15.4
№156 Fan bobi – 1; Fan bo`limi – 2; Qiyinlik darajasi – 3;
Quyidagi dastur qismi ishlashi natijasida ekranga nima chiqadi?
double a[]={2.5, 3.9, 4.8, 6.2}; int m = 0; for (int i = 1; i < 4; i++) if (a [m] < a [i]) m = i; cout
<< a [m];
6.2
4.8
3.9
2.5
№157 Fan bobi – 2; Fan bo`limi – 1; Qiyinlik darajasi – 2;
Quyidagi dastur qismi ishlashi natijasida ekranga nima chiqadi?
double a[]={2.5, 3.9, 4.8, 6.2}; double s=0; for ( int i=0;i<4;i++) s=s+a[i]; cout << s;
17.4
15
16.4
15.4
№158 Fan bobi – 1; Fan bo`limi – 2; Qiyinlik darajasi – 3;
Do'stlaringiz bilan baham: