Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 26, 2019 18:29
Show Gist options
  • Save parzibyte/31c8c18d3a3abba19e8594afa8ab45c9 to your computer and use it in GitHub Desktop.
Save parzibyte/31c8c18d3a3abba19e8594afa8ab45c9 to your computer and use it in GitHub Desktop.
// Devuelve un número aleatorio entre minimo y maximo, incluyendo a minimo y maximo
int aleatorio_en_rango(int minimo, int maximo){
return minimo + rand() / (RAND_MAX / (maximo - minimo + 1) + 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment