Update calc.cpp

Added a square function.