I'm trying to produce random numbers between 1-10 without any repetition but it's not working. Is there any way to do this without using arrays?
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<time.h>
using namespace std;
int main()
{
srand(time(0));
int randomNumber=0;
for (int i=0; i<10;i++)
{
randomNumber=(rand() % 10) + 1;
cout<<randomNumber<<endl;
}
}