added calc.c from cprog tutorial