0
Accept a numbers from user and find maximum number. Should i use array or any other logic if user inputs 5 numbers
JavaScript
2 Answers
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
0
thanks