home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
351-375
/
apd371
/
docs
/
factors.doc
< prev
next >
Wrap
Text File
|
1991-03-31
|
1KB
|
34 lines
F a c t o r s
===============
Quite a useful program, by Ben Ashley
Factors are quite interesting aren't they? Except when you have to work
them out. This program, is useful, because basically it does it all for
you, AND produces a line-form, using the factors.
As soon as you run the program, you'll be asked to enter a number. That's
all there is to it. Then, it will work them out, and display a lineform.
After all of this, you'll be asked whether or not you wish to DISPLAY the
factors, PRINT the factors, AGAIN or QUIT. If you select display, all the
factors will be displayed, and what they add up to. Selecting PRINT will
do the same, but the result will come on the printer. AGAIN allows you to
enter another number, whilst QUIT surprisingly QUITS.
After you have selected DISPLAY or PRINT, you'll be prompted for another
number.
How does it work ?
------------------
Simple. First it gets the number. Then 2 FOR..NEXT loops, count up to the
number divided by 2, ( No factors of a number, are higher than the number's
half ). It multiplies the 2 count numbers, and see's if they equal the
number. If they do, then the first counter is stored, and the loop
continues.