16.8. Exercises

Exercises for A1.4 Functions

  1. Implement and test a power function (for positive integer exponents only). A call to your function should compute baseexp and might look like:

    result = power(base, exp);

Exercises for A1.5: Arrays and Strings

  1. Copy the following program that contains an example of two different functions with array parameters: array parameters example.

    1. Try compiling and running it to understand what it is doing.

    2. Then complete the implementation of the minimum function and test it out.

  2. Write a new program, that implements your own version of a string copy function that takes a destination and a source string and copies the source string to the destination string. Test it out in main by making calls to your string copy function with different string inputs and printing out the string copy results after each call.