#include <time>
int main()
{
srand(time(0)) // <- add this so you will get random number
int array[70];
int numA;
numA =rand() % 1001;
cout << "Introduce 70 numbers " << endl;
for (int i = 0 ; i < 70 ; i++)
{
cout << " values for array["<<i<<"]" << endl;
cout<<numA<<endl;
}
cout<<"Even numbers"<<endl;
for (int i=0; i<70; i++){
if (i/2 ==0 )//<- Need a % symbol, not /
if (i%2 ==0 )
return i;
}
cout<<"Odd numbers"<<endl;
for (int i=0; i<70; i++){
if (i/2 !=0)//<- Need a % symbol, not /
if (i%2 !=0)
return i;
}
return 0;
}
Also for the Odd and Even numbers, you need to use the % modulus symbol instead of / divide. The % symbol gives you the remaind while the / just divides and thus will not give you an odd or even number just a value.