Computer Science, asked by jainmanya2288, 10 months ago

Write a javascript program to find the maximum integer n such that (1 2 ... N

Answers

Answered by Hemanth4004U
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