title: Creating an array
body: <p><em>write a program that let's the user enter 10 numbers into an array. The program should then display the largest number as and the smallest number stored in the array.</em></p>
  
  <p>I am very confused on this question that was on a previous exam and will be on the final. Any help would be appreciated! This is what I had on the test and got 3/15 points, and the code was almost completely wrong but I can post what I had if necessary, thanks! For creating the array, i can at least get that started, so like this?</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  
  {
        int array(10); // the array with 10 numbers, which the user will enter
  cout &lt;&lt; "Please enter 10 numbers which will be stored in this array" &lt;&lt; endl;
  cin &gt;&gt; array;
  
  int smallest=0; //accounting for int data type and the actual smallest number
  int largest=0;  //accounting for int data type and the actual largest number
                  //-both of these starting at 0 to show accurate results-
  </code></pre>
  
  <p>And then on my test, i started using for loops and it got messy from there on out, so my big problem here i think is how to actually compare/find the smallest and largest numbers, in the best way possible. I'm also just in computer science 1 at university so we keep it pretty simple, or i like to. We also know binary search and one other search method, if either of those would be a good way to use here to write code for doing this. Thanks!</p>