title: I am not getting any output using structures
body: <p>I'm supposed to print the name of the student with the highest average but my programme doesn't output anything any solutions? When I tried to change %s into %c in printf I got the output successfully but obviously only the first character how do I output the entire string?</p>
  <pre><code>#include&lt;stdio.h&gt;
  #include &quot;LV2 Z2.h&quot;
  int main()
  {
      int n,i;
      struct student students[40];
      
      scanf(&quot;%d&quot;,&amp;n);
      for(i=0;i&lt;n;i++)
      {
      printf(&quot;Enter the name:\n&quot;);
      scanf(&quot;%s&quot;,&amp;students[i].name);
      printf(&quot;Enter the surname:\n&quot;);
      scanf(&quot;%s&quot;,&amp;students[i].surname);
      printf(&quot;Enter the ID:\n&quot;);
      scanf(&quot;%d&quot;,&amp;students[i].studentID);
      printf(&quot;Enter the average:\n&quot;);
      scanf(&quot;%f&quot;,&amp;students[i].average);
      printf(&quot;Enter the date:\n&quot;);
      scanf(&quot;%s&quot;,&amp;students[i].date);
          
          
      }
      float max = 0;
      int bestStudent = 0;
      for(i=0;i&lt;n;i++)
      {
       if(students[i].average &gt; max) {
      max = students[i].average;
      bestStudent = i;
      }
      }
      printf(&quot;Student : %s %s ima najbolji prosjek&quot;,students[bestStudent].name,students[bestStudent].surname);
      return 0;
  }
  
  
  
  struct student 
  {
      char name[100];
      char surname[100];
      int studentID;
      float average;
      char date[100];
      
  };
  </code></pre>