Solution: Here is one solution:
square-root.c.
Refer to assignment for description of problem.
Solution: Here are two solutions, the first with just the required part and the second with the extra-credit part too:
rands1.c.
rands2.c.