You are calling the search method before the if instruction, and in the if instruction. so your helper method is being called twice, which is why it outputs if it is found twice. Delete "search(abc,number)" that is right before the if instruction and your program should work how you want it to.
No comments:
Post a Comment