Q. In an assignment statement, the value on the left of the equal sign is always equal to the value on the right.

  • (A) true
  • (B) false
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (B) false

Q. It’s perfectly all right to use variables of different data types in the same arithmetic expression.

  • (A) true
  • (B) false
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (A) true

Q. A function’s single most important role is to

  • (A) give a name to a block of code.
  • (B) reduce program size.
  • (C) accept arguments and provide a return value.
  • (D) help organize a program into conceptual units.
πŸ’¬ Discuss
βœ… Correct Answer: (D) help organize a program into conceptual units.

Q. A function argument is

  • (A) a variable in the function that receives a value from the calling program.
  • (B) a way that functions resist accepting the calling program’s values.
  • (C) a value sent to the function by the calling program.
  • (D) a value returned by the function to the calling program.
πŸ’¬ Discuss
βœ… Correct Answer: (C) a value sent to the function by the calling program.

Q. When arguments are passed by value, the function works with the original arguments in the calling program.

  • (A) true
  • (B) false
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (B) false

Q. Which of the following can legitimately be passed to a function?

  • (A) a constant
  • (B) a variable
  • (C) a structure
  • (D) all of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) all of the above

Q. When a function returns a value, the entire function call can appear on the right side of the equal sign and be assigned to another variable.

  • (A) true
  • (B) false
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (A) true

Q. When an argument is passed by reference

  • (A) a variable is created in the function to hold the argument’s value.
  • (B) the function cannot access the argument’s value.
  • (C) a temporary variable is created in the calling program to hold the argument’s value.
  • (D) the function accesses the argument’s original value in the calling program.
πŸ’¬ Discuss
βœ… Correct Answer: (D) the function accesses the argument’s original value in the calling program.

Jump to