diff --git a/exercises/random_number.cpp b/exercises/random_number.cpp index 2376baec..bb84a978 100644 --- a/exercises/random_number.cpp +++ b/exercises/random_number.cpp @@ -4,3 +4,17 @@ Output: The random number is: 4 */ +#include +#include +using namespace std; + +const int randGen(){ + srand(time(NULL)); + return rand(); +} + +int main(){ + int num = randGen(); + cout << "The random number is: " << num << endl; + return 0; +} \ No newline at end of file