Update calc.cpp

added square function.