Complex sinfidan foydalanib,ikkita complex sonlarni
ayiring
#include
#include
using namespace std;
int main(){
complex z1(3.0,1.0);
complexz2(2.0,1.0);
cout<<"ayirma=";
cout<<(z1-z2)<}
Slice sinfidan foydalanib vallarray massiv juft
o’rindagi elementlari sonini aniqlang.
#include
#include
#include
using namespace std;
int main ()
{
int sum=0;
valarray < int >vl1 (10);
cout << "Valarray toplam elementlari :\n";
for (int i = 0; i < 10; i++)
{
vl1[i] = rand () % 15-1;
cout << setw (6) << vl1[i];
vl1[slice(0,5,2)]=0;
if(vl1[i]==0)
{
sum=sum+1;
}}
cout<<"\n";
cout<<"Juft elementlar soni : "<}
Do'stlaringiz bilan baham: |