Write a javascript program to find the maximum integer n such that (1 2 ... N
Answers
Answered by
0
Answer:
23-Dec-2019 · JavaScript: Find the maximum integer n. Sample Solution: HTML Code: <! JavaScript Code: function sumn(val) { var sn = 0; var i = 0; while (sn <= val) { sn += i++; } return i - 2; } console.log(sumn(11)) console.log(sumn(15)) Flowchart:
Similar questions
Math,
5 months ago
English,
5 months ago
Computer Science,
9 months ago
Computer Science,
9 months ago
Biology,
1 year ago
Geography,
1 year ago