const int size = 2; srand(time(NULL)); int array[size] = { 33, 66 }; cout << array[rand() % size] << endl;