title: Program checking to see if a users number is stored in the array in c++
body: <p>I wrote this code to check to see whether or not a positive integer the user enters is stored in the array of the program, and then displays the result to the user. I am very new to C++ and am having some difficulties. Can someone please help me.</p>
  
  <pre><code>#include &lt;iostream&gt; //needed for access to cin and cout
  
  using namespace std;
  
  int main (void)
  {
      int LS (int [], int);
  
      int ll=10;
      int l[ll]= {30, 2, 13, 9, 25, 17, 89, 32, 73, 69};
      int i=0;
      int it=0;
      int result=0;
  
      cout &lt;&lt; " Welcome User, this program allows you to enter a number"&lt;&lt;endl
           &lt;&lt; " and see if it is stored in our database."&lt;&lt;endl;
  
      cout &lt;&lt; " Please enter number :  ";
      cin &gt;&gt; it;
  
      result = LS (l[ll], it); 
  
      if (result==0)
      {
          cout &lt;&lt; " The number" &lt;&lt; it &lt;&lt; " you entered was not found in our database. " &lt;&lt; endl;
      }
  
      if (result==1)
      {
          cout &lt;&lt; " The number" &lt;&lt; it &lt;&lt; " you entered has been found in our database. " &lt;&lt; endl;
      }
  
      return 0;
  } 
  
  
  
  int LS (int l[int ll], int it) //function to search for "it"
  {
  
      int i=0, f=0; 
  
      if (l[i]==it)
      {
          f=1; 
          i++;
      }
  
      if (i==ll)
      {
          return f;
      }
  }
  </code></pre>