Update prog1.cpp

added function- add().