Update cal.cpp

included square function