TO FIND THE SUM OF N NATURAL NUMBERS USING FOR LOOP IN VBSCRIPT

<html>
 <body>
 <script type="text/vbscript">

 dim I,N,sum
sum=0
n=cint(inputbox("Enter the limit"))
for i=1 to n
 sum=sum+i
  next
 document.write("SUM=  "&sum&"<br>")

</script>
</body>
</html>

No comments:

Post a Comment