title: Error in getting input in structure using gets()
body: <p>I am making a program to take input in teacher structure but there is unknown run time error , here is the code - </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;conio.h&gt;
  
  struct Teacher
  {
   char Name[30];
   char Qualifications[20];
   int experience_year;
  }th[10];
  
  void teacher()
  {    
   int t,i;
   printf("Enter how many teachers are in department\n");
   scanf("%d",&amp;t);
   for(i=1;i&lt;=t;i++)
   {       
     printf("Enter name of teacher : ");
     gets(th[i].Name);
     printf("Enter qualification of teacher : ");
     gets(th[i].Qualifications);
     printf("Enter experience_year of teacher : ");
     scanf("%d",&amp;th[i].experience_year);
   }
   for(i=1;i&lt;=t;i++)
   {
     printf("Details of %d teacher\n",i);
     printf(th[i].Name);
     printf(" ");
     printf(th[i].Qualifications);
     printf(" ");
     printf("%d",th[i].experience_year);
     printf("\n");
   }
  }   
  int main()
   {
     teacher();
     return 0;
   }
  </code></pre>
  
  <p>Output is -</p>
  
  <pre><code>Enter number of teacher
  1
  Enter teachers name : Enter qualification of teacher :
  </code></pre>
  
  <p>How to get teacher's name(input).. and what is the error ?</p>