Embed presentation
Download to read offline
![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](https://image.slidesharecdn.com/createanarraythatholds1000randomintegersbetween1-1000-230704223123-ef7162b2/85/Create-an-array-that-holds-1000-random-integers-between-1-1000-Allo-pdf-1-320.jpg)
The document outlines a program that creates an array of 1000 random integers between 1 and 1000. It allows the user to enter a number to search for its location in the array and responds whether the number exists or not. The provided code includes basic structures and prompts for user input.
![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](https://image.slidesharecdn.com/createanarraythatholds1000randomintegersbetween1-1000-230704223123-ef7162b2/85/Create-an-array-that-holds-1000-random-integers-between-1-1000-Allo-pdf-1-320.jpg)