cout<<"\n";
cout<< "O'rta Arifmetigi" <<" " ;
float sum=0;
for (int i = 0; i
sum = sum + a[i];}
cout<< sum/n <<"\n" <
cout<<"O'rta geometrigi"<<" " ;
double T=1;
for (int i = 0; i
T*=a[i];}
cout<< pow(T,1./n)<<"\n" <
for(int i=0; i
if(a[i]pow(T,1./n) ) t++;
cout<<" Shartni bajaruvchi " <
cout<<"\n"; main(); }
3. x=(x1,…,xn) massivining birinchi 5ta musbat elementlarini Y=(y1, y2, …, y5) massiviga ketma ket yozing.
ni hisoblang.
#include
using namespace std;
int main(){
int n;
cout << "Massivning elementlari sonini kiriting" << endl;
cin >> n;
int massive[n];
int i=0;
while (i
{
cout << i+1 << "-elementni kiriting ";
cin >> massive [i];
i++;
};
i=0;
int j=0, yigindi=0;
int massive2[n];
while (i<5)
{
massive2[j] = massive[i]; yigindi=yigindi+massive2[j]; j++; i++; };
cout << endl << yigindi << endl<< "Dastur tugadi";
system ("pause");
return 0;
}
4.
a = {1,2; 1,7; 3,5; 1,6; 4,9; 2,1},b= {9,2; 7,8; 8,3; 3,5; 5,7;7,3}
(i=1,…,6). Ik
kita massiv berilgan.formula asosida X massivini hosil qiling va chop eting.
#include
#include
#include
#include
using namespace std;
int main(){
float n=11;
float z[]={0.1,7.5,1.1,0.26,0.13,14,2.5,8,0.75,0.01,3.4};
cout<<"Berilgan z[] massiv elementlari: \n\n "<
for(int j=0; j
{
cout<
cout<
float Y[11];
for(int n=0; n<11; n++)
Y[n]=z[n]/log10(z[n]);
cout<<"Yangi hosil qilingan Y[n] massiv elementlari: \n\n";
for(int n=0; n<11; n++)
cout<
system("pause");
return 0;
}
Do'stlaringiz bilan baham: