Skip to content

Instantly share code, notes, and snippets.

@Yapcheekian
Created May 30, 2021 00:00
Show Gist options
  • Select an option

  • Save Yapcheekian/0e7dcdac659f3355d22ab149f8aef342 to your computer and use it in GitHub Desktop.

Select an option

Save Yapcheekian/0e7dcdac659f3355d22ab149f8aef342 to your computer and use it in GitHub Desktop.
Random number generator in c
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main(int argc, const char * argv[]) {
srandom(getpid());
for (int i = 0; i < 16; i++) {
long int r = random();
printf("%ld\n", r);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment