title: How to print all elements of an array in C after I enter all of them?
body: <p>So I have this code in C:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      int a[9], number_of_elements;
      printf("Enter 10 numbers: \n");
      for (int i = 0; ((i &lt; 10) &amp;&amp; (a[i] != 0)); i++) {
          scanf_s("%d", &amp;a[i]);
          if (a[i] == 0) {
              number_of_elements = i;
              break;
          }
          if (a[i] != 0) {
              number_of_elements = i + 1;
          }   
      }
      printf("There is %d elements.\n", number_of_elements);
      return 0;
  }
  </code></pre>
  
  <p>As you can see, I have to enter max 10 elements into an array, or stop entering when you enter 0, and after that I have to print all elements of that array and how many elements array have. I sorted all things except printing all elements of the array, can anyone help me how to do that?</p>