title: Calculating the sum of your name given every letter a number
body: <p>I'm trying to solve this program which aims to ask the user to enter his name while given every letter of the alphabet a number e.i(a=1,b=2...) then calculate the sum of the name (Using arrays and strings)
  This is the code I've tried Can someone help me with it. Thanks </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main (void){
  int letters [] = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
  int sum, i, j, count=0;
  char numbers [] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26};   
  char name [50];
  char ch;
  printf("Enter a name --&gt; ");
  for(i=0;i&lt;50;i++){
  scanf("%c", name [i]);
  ++count;
  }
  for(j=0;j&lt;=count;j++){
      for(i=0;i&lt;26;i++){
          if(name [j] == letters [i])
          sum += numbers[i];
      }
  }
  printf("Your name is: ");
  for(i=0;i&lt;=count;i++)
  printf("%c", name[i]);
  printf("\n");
  printf("The sum of your name is: %d\n", sum);
  return (0);
  }
  </code></pre>