title: gets is not working in c
body: <p>In the Bellow C program, <code>gets</code> is not working so I have used <code>scanf</code> to get the student name from the standard input.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  
  struct student
  {
      char name[10];
      int roll, sub[6], total, age;
  };
  
  int take(int n, struct student s[])
  {
      int i, j;
  
      for(i=0;i&lt;n;i++)
      {
          s[i].total=0;
          printf("\n\nEnter the name of the %d student :",i+1);
          gets(s[i].name);//over here gets is not working
          //scanf("%s",s[i].name);
          printf("Roll no :");
          scanf("%d",&amp;s[i].roll);
          printf("Enter your Age : ");
          scanf("%d",&amp;s[i].age);
          for(j=0;j&lt;6;j++)
          {
              printf("Enter the Marks of Subject %d : ",j+1);
              scanf("%d",&amp;s[i].sub[j]);
              s[i].total=s[i].total+s[i].sub[j];
          }
      }
  }
  
  main()
  {
      int n;
      struct student s[10];
      printf("Enter how Student Details you want to Enter : ");
      scanf("%d",&amp;n);
      take(n, s);
  }
  </code></pre>
  
  <p>How can I use <code>gets</code>?</p>