Abstract
In this chapter we put the computer to work doing the kind of tasks it does best, repetitions of simple procedures. How long would it take you to add the first 1000 odd numbers? Before taking pencil in hand, let’s see how to program the VIC to solve this problem. There are several ways to find the answer but one of the simplest is:
-
5 S = 0: CO = 0
-
10 FOR Q = 1 TO 1999 STEP 2
-
20 LETS = S + Q
-
30 PRINT S
-
40 NEXT
-
50 PRINT “THE SUM IS”;S
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 1983 Birkhäuser Boston, Inc.
About this chapter
Cite this chapter
Kahn, D., Scrimshaw, N.B. (1983). Number Theory 1. In: Discover Your VIC-20. Birkhäuser Boston. https://doi.org/10.1007/978-1-4615-9816-9_9
Download citation
DOI: https://doi.org/10.1007/978-1-4615-9816-9_9
Publisher Name: Birkhäuser Boston
Print ISBN: 978-1-4615-9818-3
Online ISBN: 978-1-4615-9816-9
eBook Packages: Springer Book Archive