In next code I've same result everytime although using "srand" and followed instructions of the next link rand() and srand() in C/C++:
#include <iostream>
#include <cstdlib>
using namespace std;
int main(void)
{
int i, x;
srand(5);
for(i=1;i<=10;++i)
{
x=rand()%5;
cout << x << endl;
}
return 0;
}