Learn
Code Challenge: C++ Functions
First Three Multiples

first_three_multiples()

Instructions

1.

Write a function named first_three_multiples() that has:

  • An int parameter named num.

The function should return an std::vector of the first three multiples of num in ascending order.

For example, first_three_multiples(7) should return a vector with 7, 14, and 21.

Folder Icon

Take this course for free

Already have an account?