#C++ (gcc), 98 bytes
C++ (gcc), 98 bytes
#import<cstdio> #import<cstdlib> #define d printf("%i ",x int p(int x){d);while(x>0)d=rand()%x);} Usage
int main() { p(100); } This is my first code golf attempt. Any feedback or remarks are welcome.
Edit: Removed the main function as suggested to make it valid.