Skip to main content
3 of 3
Commonmark migration

C++ (gcc), 98 bytes

#import<cstdio> #import<cstdlib> #define d printf("%i ",x int p(int x){d);while(x>0)d=rand()%x);} 

Try it here!

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.

eKKiM
  • 161
  • 6