Question: Define function by giving different values???

How to write a program that obtains the value of the function by giving different values
Like the example below:

 

Please Wait...