this is my code
#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, const char * argv[]) {
int x=0;
int y;
int check;
cin>>y;
int array[y];
int array1 [y];
while (x<y) {
check=rand() % 101;
if (check>100){
if (check<0){
array[x]=7;
}
}
cout<<array[x]<<endl;
x++;
}
x=0;
while (x<y) {
if((array[x]%2)==0){
cout<<array[x]<<" is even"<<endl;
}
else if ((array[x]%2)>0){
array1[x]=array[x];
}
x++;
}
x=0;
while (x<y) {
cout<<array1[x]<<" is odd "<<endl;
x++;
}
}
And this is the out come
9
0
1
0
11892
1
4287072
1
-381468224
0 is even
0 is even
11892 is even
4287072 is even
-381468224 is even
9 is odd
1 is odd
1 is odd
1 is odd
1876947472 is odd
1 is odd
-2125276220 is odd
1 is odd
48 is odd
Program ended with exit code: 0
Im making a program that checks how many numbers you want it to use and chooses that many random numbers between 1 -100.