what is the problem in this motor control arduino code

Once your character is '3', it never stops being '3', so repeats every time through loop().

Please use code tags.