3-variant
1-topshiriq
1.
A sonini n marta tasodifiy sonlar bilan to’ldiring . Juft
sonlarni ekranga chiqaring
#include
#include
#include
using namespace std;
int main()
{
int a, n;
cout << "Usmonov Oyatillo" << endl;
cout << "N ni kiriting = "; cin >> n;
for (int i = 1; i <= n; i ++)
{
a = rand();
if (a % 2 == 0)
{
cout << a << ' ';
}
}
}
2-topshiriq
3.
Berilgan
massivdan
formulasi yordamida
, massivini hosil qiling va chop eting.
#include
#include
#include
using namespace std;
int main()
{
int z[222], b[232];
cout << "Usmonov Oyatillo" << endl;
for (int i = 1; i <= 9; i ++)
{
cin >> b[i];
}
for (int i = 1; i <= 9; i ++)
{
z[i] = pow(b[i] * b[i], 2/3);
}
cout << "Natija = ";
for(int i = 1; i <= 9; i ++)
cout << z[i] << ' ';
}