// square.cxx #include #include using std::cout; using std::cin; using std::endl; int main() { int number, square = 1, count = 1; cout << "Enter the number for which you want " << "the nearest larger square\n"; cin >> number; while( square <= number ) { count = count + 2; square = square + count; } cout << "The nearest square larger than " << number << " is " << square << endl; return EXIT_SUCCESS; }