Function added

Functions added and program for calculation added.