#include <ctime> /* or <time.h> for time() */ #include <stdlib.h> /* for srand() and rand() */ srand(time(0)); /* set up random number generator based on current time */ int random = rand() % 10; /* from 0 to 9 inclusively */rand() produces a random integer ranged from 0 to RAND_MAX, which is defined in <stdlib.h>. ◀ Useful Functions▶ Parsing a string