Modified the code since I now know how to retrieve a single character based on its position ralative to string which has been given by the standard input