Please keep it as simple as possible, there is no need for a random number generator and we aren't supposed to use functions. The language is C++, thank you in advance.
#include <iostream>
using namespace std;
int main() {
int arr[1000];
cout << "How many numbers do you want to enter? ";
int size;
cin >> size;
cout << "Enter " << size << " integers(0-1000): ";
for (int i = 0; i < size; ++i) {
cin >> arr[i];
}
int counts[1001] = {0};
for (int i = 0; i < size; ++i) {
counts[arr[i]]++;
}
int mostCommon = 0;
for (int i = 0; i < 1001; ++i) {
if (counts[i] > counts[mostCommon])
mostCommon = i;
}
cout << "Most common number is " << mostCommon << " and it appears " << counts[mostCommon] << " times." << endl;
return 0;
}


Write code that scans an array of random integers, whose value is between 0 and 1000,...