#include <stdlib.h>
#include <time.h>
#include <iostream>
using namespace std;
#define N 16
void main()
{
int randomNumbers[N];
srand(time(NULL));
for (int i = 0;i < N; i++)
randomNumbers[i] = rand() % 40 - 20;
}
for (int i = 0; i < N; i++)
cout << randomNumbers[i] << " ";
cout << endl << endl;
if (randomNumbers[i] % 2 == 0)
cout << endl;
#include <stdlib.h>
#include <time.h>
#include <iostream>
using namespace std;
#define N 16
void main()
{
int randomNumbers[N];
srand(time(NULL));
for (int i = 0;i < N; i++)
{
randomNumbers[i] = rand() % 40 - 20;
}
for (int i = 0; i < N; i++)
{
cout << randomNumbers[i] << " ";
}
cout << endl << endl;
for (int i = 0; i < N; i++)
{
if (randomNumbers[i] % 2 == 0)
{
cout << randomNumbers[i] << " ";
}
}
cout << endl;
}