Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need a help in a question in C++ language. the question is : I have two arrays

ID: 3618623 • Letter: I

Question

I need a help in a question in C++ language.
the question is :
I have two arrays with different sizes,, the first one should belarger than the second,, both of them are from the type integer.they are filled with numbers by the user. (the first array shouldbe filled in ascending order)
Then the program should take each cell in array 2 ,, and search inarray 1 if it is availble or not,
if yes , then show in which position it is, the part which I amstuck in, is the searching part,, Actually I did it but myinstructor says that there is something wrong in it:
note : K is number of elements in array 2
          C is numberof elements in array 1
the code is :

    for(int t=0; t<K ; t++)
        {
            for(intu=0; u< C; u++)   
            {
               if(array1[u]== array2[t])
               {
                   cout<<array2[t]<<" available at podition "<<u+1<<endl;
                   break;
               }


               if(array1[u] != array2[t] && u==N-1) // this means if we reached the end of the
                                                                                array and still we didn't find it>>not available

                   cout<<array2[t]<<" not available"<<endl;


            }
        }

ANY HELP ?

Explanation / Answer

Please it's urgent :S

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote