what is the c++ code for mid-square hashing?

in this program, you will get the middle digits and square it:
example:
enter number:12345
enter mid number positions to square:234
234^2
=54756//get the last two digits
the final answer is:56

another example:
enter number:235324
enter mid number positions to square:345 (3rd(5)4th(3)5th(2))
532^2
=283024//get the last two digits
the final answer is:24
Please post your non-working code, otherwise we don't do people's homework for them.
Topic archived. No new replies allowed.