Using visual basic to find 1 + 3 + 5 + +The maximum value of n when the sum of n is less than or equal to 1000

Using visual basic to find 1 + 3 + 5 + +The maximum value of n when the sum of n is less than or equal to 1000

10 N=-1
20 S=0
30 N=N+2
40 S=S+N
50 IF S