16.8. Exercises
Exercises for A1.4 Functions
-
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
-
Copy the following program that contains an example of two different functions with array parameters: array parameters example.
-
Try compiling and running it to understand what it is doing.
-
Then complete the implementation of the
minimum
function and test it out.
-
-
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.