title: scanning a string using structure
body: <p>this below is the c code for the structure. in this program while scaning the value of name program is terminating from that point.  and also it takes 2 values as name array. its not giving any runtime error or warning. can u tell me what is the proper solution for this program on my email id <code>....</code></p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  struct student
  {
      int id;
      char name[20];
      float per;
  } st;
  main()
  {
      clrscr();
      printf("\nenter the info of student");
      printf("\n=======================\n");
      printf("id:");
      scanf("%d:",&amp;st.id);
      printf("name :");
      scanf("%s :",st.name);
      printf("per :");
      scanf("%f :",&amp;st.per);
  
      printf("\n id is: %d \n",st.id )  ;
      printf("\n name is: %s \n",st.name )  ;
      printf("\n per is: %1f \n",st.per )  ;
      getch();
      return 0;
  }
  </code></pre>