Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Possible purposes of using functions are (incomplete list):
Below is an example that asks the user for two values and calculates whether these and the sum of these values are prime. The first piece of code does not use functions, the second does. In comment is shown which of the four purposes are served.
#include <cmath> |
#include <cmath> |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.