11.12. Activecode ExercisesΒΆ

Answer the following Activecode questions to assess what you have learned in this chapter.

Q1

Write the function random_nums that takes two integers: num which is the number of random numbers to generate, and max, which is the maximum value of random number you wish to generate. Your function should return a vector of num integers that are between 1 and max, inclusive.

Example vectors_a8
1#include <iostream>
2#include <random>
3#include <vector>