#include <iostream> #include <stdlib.h> #include <time.h> using namespace std; int main() { srand(time(NULL) ); const char arrayNum[7] = {'0', '1', '2', '3', '4', '5', '6'}; int RandIndex = rand() % 7; cout<<RandIndex<<endl; return 0; }