File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed
0017 GenerateRandomNumber Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 1- # Problem 15 (L-B) ~ Area Of Triangle
1+ # Problem 16 (L-B) ~ Area Of Triangle
22
33## Problem
44
Original file line number Diff line number Diff line change 1+ # Problem 17 (L-B) ~ Generate Random Number
2+
3+ ## Problem
4+
5+ This program generates a random number between minimum and maximum value.
6+
7+ ## Solution
8+
9+ ``` javascript
10+ let min = 0 ;
11+ let max = 10 ;
12+
13+ console .log (Math .floor (Math .random () * (max - min + 1 )) + min);
14+ ```
15+
16+ ## References
17+
18+ - [ freeCodeCamp] ( https://www.freecodecamp.org/news/javascript-random-number-how-to-generate-a-random-number-in-js/ )
19+
20+ ## Problem Added By
21+
22+ - [ GitHub] ( https://github.com/Shiva-Sai-ssb )
23+
24+ ## Contributing
25+
26+ Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
27+
28+ Please make sure to update tests as appropriate.
29+
Original file line number Diff line number Diff line change 1+ let min = 0 ;
2+ let max = 10 ;
3+
4+ const randNum = Math . floor ( Math . random ( ) * ( max - min + 1 ) ) + min
You can’t perform that action at this time.
0 commit comments