problem:char taking more than one value

Are you printing input[0] six times?