Which of the following is an example of a higher-order function?

Which of the following is an example of a higher-order function?

a) A function that takes a string as input
b) A function that returns a number
c) A function that takes another function as an argument
d) A function that modifies global variables

Answer:

c) A function that takes another function as an argument

Explanation:

A higher-order function is one that takes another function as an argument or returns a function as a result.

Reference:

Functional Programming Quiz – MCQ Questions and Answers

Scroll to Top