how to write a program of functions accepting values and returning values?
Your question is essentially "how do I write a program using functions?", which is extremely vague and basic. Do you know how functions work and the syntax for defining them?
Also, we don't do your homework.