Skip to main content

Section 12.2 Practice: Single Functions

Check Your Understanding Check Your Understanding

1.

Please add the correct prototype for the square() function to the program below:
When your program performs correctly you’ll be given a keyword to enter in Canvas.

2.

Write a function divide() that takes two floats as arguments and returns a float, namely the first number divided by the second. Obviously, you shouldn’t be dividing by zero...
You may assume that your function is not called with such input.
When your program performs correctly you’ll be given a keyword to enter in Canvas.