Display Natural numbers sum up to n? (using While...Wend Loop)

Dim num, n, sum
n= inputbox ("Enter a Value")
While num <=cdbl (n)
sum= sum+num
num=num+1
Wend
msgbox sum
Display Natural numbers sum up to n? (using While...Wend Loop) Display Natural numbers sum up to n? (using While...Wend Loop) Reviewed by Animesh Chatterjee on January 23, 2010 Rating: 5

No comments:

Powered by Blogger.