Răspuns:
#include <iostream>
using namespace std;
void readA(int &n, int a[])
{
int i;
cout<<"n=";
cin>>n;
for(i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
}
void check1(int &n, int a[])
{
int i;
for(i=1;i<=n;i++)
{
if(i%2==0)
{
if(a[i]%2!=0)
{
cout<<"a["<<i<<"]="<<a[i]<<endl;
}
}
}
}
int main()
{
int n, a[101];
readA(n, a);
cout<<endl;
check1(n, a);
}
Explicație: