top of page
shishantpandey

find sum of number in advance mode javascript

Updated: Sep 21, 2022

var myinputarr = []; var size = 5; // Array size alert("enter number and press enter if need not mare press cancle"); myinputarr[0] = Number(prompt("Enter array Element ")); let a = 0; let total = 0; while (myinputarr[a] != 0) { total = myinputarr[a] + total; a++; myinputarr[a] = Number(prompt("Enter array Element: ")); } console.log(total);



2 views0 comments

Recent Posts

See All

留言


Post: Blog2_Post
bottom of page