please help i'm stuck on something for a project i'm doing
i need to display the numbers 1 to 9 randomly but they cannot be repeated!
the code i have so far is this:
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
srand((unsigned)time(0));
int random_integer;
int lowest=1, highest=9;
int range=(highest-lowest)+1;
for(int index=0; index<9; index++)
{
random_integer = lowest+int(range*rand()/(RAND_MAX + 1.0));
cout << random_integer ;
}
}