0

Accept a numbers from user and find maximum number. Should i use array or any other logic if user inputs 5 numbers

JavaScript

12th Oct 2017, 10:11 AM
Abhay
2 odpowiedzi
0
Use array var arr = []; for(var i=0;i<5;i++) arr.push(prompt("Enter number")); alert('Max: ' + Math.max(...arr)); https://code.sololearn.com/Wq1TXSSLbhx1/?ref=app
12th Oct 2017, 12:44 PM
Calviղ
Calviղ - avatar
0
thanks
12th Oct 2017, 4:18 PM
Abhay