#include "library.h" int sqroot(const int square, const int first, const int last) { if (first > last) return -1; const int middle = (first + last) / 2; const int seen = middle * middle; if (seen == square) return middle; if (seen < square) return sqroot(square, middle + 1, last); else return sqroot(square, first, middle - 1); } int sqroot(const int square) { return sqroot(square, 0, square + 1); } void main() { cout << "Enter a number: "; const int number = read_int(); const int root = sqroot(number); cout << "The square root is " << root << "\n"; main(); }