title: program in C that reverse a string
body: <p>I wrote a program in C that asks a user for his name and output the number of letters, and ask again the user if he wants his name to be reversed if his response is yes, the program output the reversed name. 
  the problem is I don't know why I lose the first letter in the array name
  you can try this code. I think scanf is the source of the problem.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(){
    char name[30],reponse[3],response[3]="yes",temp;
    int j,i,t=0,k;
    printf("would you share with us your name ? \n");
    scanf("%s",name);
    printf("so your name is %s\n",name);
    for(i=0;i&lt;=30;i++){
      if(name[i]!='\0') t++ ;
      else break;
    }
    printf("the number of letters in your name is %d\n",t);
    printf("do you want your name to be scrumbled ?\n");
    scanf("%s",reponse);// I think the problem is here
    for(j=0;j &lt; 3;j++){
      if(response[j]!=reponse[j]) break;
    }
    if(j==3){
      k = t/2;
      for(i=0; i&lt;k;i++){
         temp=name[i];
         name[i]=name[t-i-1];
         name[t-i-1]=temp;
      }
      printf("your new name is %s hahaha ",name);
    }
    else printf("OK");
    return 0;
  }
  </code></pre>