Answer to Question #322756 in C++ for nickname

Question #322756

Look at the following code and identify what is wrong with it:

 

void multiply(int, int);

 

int main() {

  std::cout << "The answer is: " << multiply(num1, num2);

}

 

void multiply(int a, int b) {

  return a * b;

}

 

Prototype is missing variable names

Int parameters should be doubles

Void functions cannot return a value

Value-returning functions must be called in a statement that stores the returned value in a variable


1
Expert's answer
2022-04-03T03:45:11-0400

Answer: Void functions cannot return a value.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS