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

January 23, 2010

Dim num, n, sum
n= inputbox ("Enter a Value")
While num <=cdbl (n)
sum= sum+num
num=num+1
Wend
msgbox sum

You Might Also Like

0 comments