#include <iostream>
using namespace std;

int main()
{
   int i, x;
   int range;
   
   srand(time(0));
   cout << "Enter range of random number: 0..(?-1): ";
   cin >> range;
   
   x = rand() % range;
   
   for(i=0; i < 10; i++)
   { 
      x = rand() % range;
      cout << x << endl;
   }
   
   return 0;
} 


syntax highlighted by Code2HTML, v. 0.9.1