top of page

HOW TO FIND FUM OF FIRST N NATURAL NUMBER IN JAVASCRIPT




let sum = 0; let lastnum = prompt("enter the number"); a = Number.parseInt(a); for (let i = 0; i <= lastnum; i++) { sum = i + sum; } document.write("sum of all the numbers is", sum);






Comments


Post: Blog2_Post

6204596395

  • Instagram
  • LinkedIn

©2022 by shishantPandey. Proudly created with Wix.com

bottom of page