Friday, July 31, 2009

C++ programming question?

how can i use C++ to write a program that will ask the user to think of a number, than the program will have a initiate guess of 100, if that is not the number, it will do some simple math until it gets the number.

C++ programming question?
should start at 50 and do a binary search (keep splitting in half)


if it's high than 50 you only concentrate on 51 up. Next guess should be 75..if it's lower than that you now only have 51-74 left to look at...next guess is center of that..62 ....and so on....


No comments:

Post a Comment