05-12-2008, 08:45 PM
LPG:
I think that your original code is O.K., as it counts any "5" in the inputted string, whether the user enters a number or a string. That was the OP's proposal. Who care if one inputs a string or a number, the question is, "How many characters "5" are there in what I inputted?". Your code answers the question correctly.
I think that your original code is O.K., as it counts any "5" in the inputted string, whether the user enters a number or a string. That was the OP's proposal. Who care if one inputs a string or a number, the question is, "How many characters "5" are there in what I inputted?". Your code answers the question correctly.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.