Help me to find error in my code


// Define first_three_multiples() here:
int first_three_multiples(int num){
std::vector multiples ;
return multiples;

int main() {

for (int element : first_three_multiples(8)) {
std::cout << element << “\n”;


There’s a problem with how you declared the function, and where you declared the vector.

The beginning of the first_three_multiples function should be

std::vector<int> first_three_multiples(int num){
  std::vector<int> multiples;

because you are trying to return a vector of ints, not a single int.
And the type inside the vector would be declared here using <int> .

1 Like