I know you're just starting off, but get a book on data structures and algorithms, if you plan to eventually use this code in something serious.
A "good" solution to your search problem is going to depend on the type of data you are search for ( integers?, strings?), the size of the array, are you looking for space ( memory ) or time ( CPU ) optimizations.
One integer approach is to make the array index the number. This would work if you have a bounded range or do not mind reallocating member. Therefore if the user enters '5' you do,
arrayOne[5]=1;
etc., That way your search loop becomes
for(int i=0;i<userInputSize;i++)
{
currentNumber = arrayTwo[i];
if(arrayOne[currentNumber]==1)
/* We have a match. Do stuff here */
}
The above can have *big* advantages if you make arrayOne a bitfield ( ie. an array of 'bits' instead of integers which would be 32 bits instead of 1 ).
But more importantly the algorithm is of order N instead of N^2 as the one you posted was. With your algorithm, the time it takes to execute will grow expontentially. The code will be twice as slower for every additional element in the array.
The second algorithm should grow linear.
So check out algorithms and data structures. Interesting stuff