title: Find the character of a string by inputting the position in c
body: <p>Hi I know that there are alot of examples where you input a character to and output the position of the character. But how do you do it the other way around where you input the position and output the character ?</p>
  
  <ul>
  <li>input string: abcdefghijklmnopqrstuvwxyz</li>
  <li>input position: 0</li>
  <li>output: The character in position 0 is 'a'</li>
  </ul>
  
  <p>Do I use <code>atoi</code>? </p>
  
  <pre><code>int main(void) {
  
  char line[SIZE];
  int position;
  
  // int character = getchar(); //get string
  scanf("%d\n", &amp;position); //get position
  int i = 0;
  while(fgets(line, SIZE, stdin) != NULL) {
      if(line[i] == position) { 
         printf("The character in postion %d is '%c'\n", position,line[i]);   
          //flag = TRUE;
     // }
      i++;
  }       
  
  return 0;
  }
  </code></pre>