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
Science,
5 months ago
Hindi,
5 months ago
Science,
5 months ago
Computer Science,
10 months ago
Computer Science,
10 months ago
Biology,
1 year ago
Geography,
1 year ago