title: How do you assign user input to be stored into arrays
body: <p>My challenge is to write a program that will store a user's GPA as a float value in a array. The user can enter up to 30 GPA's and display the average if wanted, after each value is iuput. What I'm confused about is how to use a <code>scanf()</code> function while in a loop to store float values in an array. Can anyone explain with a sample code?</p>
  
  <p>OK so this is the code that I have started. I know it's bogus but I wanted everyone to get a better idea of the program I'm trying to write. I want the user to type in how many GPA's they have. The number they input will be the number of arrays I will have.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  main()
  {
      int loopcount = 0;
      int NumGpa = 0;
      NumGpa = 0 - 1;
      float = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25;
      int gpa[NumGpa] ={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
      int i = 0;
      int total =0;
  
      printf("\t\tWelcome to the GPA calculator.\n ");
      printf("Please enter the number of classes you have counted for you GPA: ");
      scanf("%d", &amp;NumGpa);
  
      while (loopcount &amp;lt; NumGpa)
      {
          printf("\nenter your first GPA: ");
          scanf("%d", &amp;1); //??????????????(i want loops to use scanf() if order &amp;2,&amp;3 ect?
  
          for (i=0; i&amp;lt;gpa; i++)
          {
              total += arbin[NumGpa];
          }
  
          printf(" you average gpa is %d", NumGpa / ????);
          getchar();
      }
  }
  </code></pre>