Skip to content

Instantly share code, notes, and snippets.

@thenamankumar
Created May 7, 2024 13:53
Show Gist options
  • Save thenamankumar/64ab4e27d450954de947de273bdbdd88 to your computer and use it in GitHub Desktop.
Save thenamankumar/64ab4e27d450954de947de273bdbdd88 to your computer and use it in GitHub Desktop.
Write a program to generate N random integers between 0 and 99 inclusive.
Then display a histogram of those numbers on the command line, with each line corresponding to a bucket of size 20.
So if it is asked for 10 numbers, and behind the scenes the program generated:
52, 15, 62, 26, 57, 15, 7, 81, 95, 49
Then the command and output would look like this:
$ histogram 10
***
*
***
*
**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment