# Thread: Storing random number in array(sequential search & bubble sort)

1. ## Storing random number in array(sequential search & bubble sort)

i have generate random number, 1 - 20, such a sequence may or may not contain duplicates. Print each number as it is generated, and store it in an array, but only if it is not a duplicate of a number already stored.
Code:
```for(int i=0;i<20;++i) {
randomInt=rand()%20+1;
cout<<randomInt<<endl;  // print each number

MyRand[i]=randomInt;  //how to store all unique number(no duplicates in a one-dimensial array (use sequential search) - Use a function to search the existing array
}

// After you have created the array, print it along with its actual size - Use a function to print the array.

// Then print the array again, this time in sorted in increasing order - Use a function to sort the array (use bubble sort)```
Please can anyone guide me into successfull coding. I need this ASAP, coz the due date is near. Please help, i am beginner , i am trying to learn. E-mail me at: joeraj7@yahoo.com

2. Word of advice: we dont like blatently helping people with homework. We'll give you hints, but we wont do the work for you.

3. ## Help

I could not do the part of storing the unique number in arrays (using sequential search). I really cannot understand that part, can anyone help me to code that part, and i will continue from there and finish my work on my own.

4. Start by reading a tutorial or a sorting algorithm?

5. ## help needed

I cannot understand sequential search.

How do i store the unique random numbers (without duplicate), compare the first element with every element and store it, and if the element is equals to any of it, dont store it, but how to do that, any clue, please help?

6. I cannot understand sequential search.
Ever tried flipping through a pile of notes page by page to find the page you want?