Node:Questions for Chapter 4, Previous:The exit function, Up:Functions



Questions for Chapter 4

  1. Write a function that takes two values a and b, then returns the value of a * b (that is, a times b.)
  2. Is there anything wrong with a function that returns no value?
  3. What happens if a function returns a value but you do not assign that value to anything?
  4. What happens if a variable is assigned the result of a function, but the function does not return a value?
  5. How can you make a program terminate, anywhere in the program?