Create an array that holds 1000 random integers between 1-1000. Allow the user to enter an
integer to search. Output the location of number if it exists in the Array. (Number could appear
more than once.) or Output number does not exist in the Array.
Solution
#include
#include
void main()
{
int size,num;
boolean flag=false;
cout<< "how big do you want the array?" << endl;
cin >> size;
int array[size];
for(int i=0; i> num;
for(int i=0; i

Create an array that holds 1000 random integers between 1-1000. Allo.pdf

  • 1.
    Create an arraythat holds 1000 random integers between 1-1000. Allow the user to enter an integer to search. Output the location of number if it exists in the Array. (Number could appear more than once.) or Output number does not exist in the Array. Solution #include #include void main() { int size,num; boolean flag=false; cout<< "how big do you want the array?" << endl; cin >> size; int array[size]; for(int i=0; i> num; for(int i=0; i