#include <stdio.h>

int main()
{
   int i, x;
   int range;
   
   srand(time(0));
   printf("Enter range of random number: 0..(?-1): ");
   scanf("%d", &range);
   
   x = rand() % range;
   
   for(i=0; i < 10; i++)
   { 
      x = rand() % range;
      printf("#%d: %d\n", i, x);
   }
   
   return 0;
} 


syntax highlighted by Code2HTML, v. 0.9.1