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 : "<}