Above main are placed the names, return types and parameter lists of all the functions it will call upon. Below main are placed all the function definitions . These include the return type, name and parameter lists of each function together with a detailed sequence of statements which fully describe what it does. Functions can have data values passed to them from the main function when they are called. These data values are passed to the functions via their parameters .
Functions can return data values back to the main function.
Write a function which accepts two integer parameters, adds these values and returns the sum to the calling code. Write a program which allows the user to enter two integers at the keyboard then sends these two values to the function. In Task 3 of Topic 9 you wrote a program which allowed the user to choose from a list of shapes and calculate the area of their chosen shape. In that program, each of the shape-area functions printed the result on the screen. Modify the functions in the program so that each one returns the area to the calling code.