This is a simple example to generate random numbers between 1 and 6, I think you can portray the rest
#include <iostream> #include <cstdlib> #include <ctime> int main() { srand(time(0)); std::cout << (rand() % 6 + 1) <<std::endl; return 0; }
source share