Skip to main content

Section 12.4 Practice: Multiple Functions

Check Your Understanding Check Your Understanding

1.

What are some of the advantages of using functions (choose all that apply)?
  • easy modification of code
  • Correct
  • abstraction
  • Correct
  • ability to reuse code without having to copy and paste
  • Correct
  • there are no advantages
  • Not quite. Try again!

2.

Given the following function definition, which is the correct function call, given that a variable a of type int has been declared?
int myaddition(int x, int y)
{
  return(x+y);
}
Feel free to use the window below to try out some code. Be sure to work the correct answer out "by hand" first before verifying your answer using the code window.

admin.....open in new window

  • a = myaddition(3,5);
  • Correct
  • a = myaddition(3,5)
  • Not quite. Try again!
  • int a = myaddition(3,5)
  • Not quite. Try again!
  • a = myaddition(3.0,5.0);
  • Not quite. Try again!