Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +--------------------------------------------+
- | Originally written on a TI-83 calculator. |
- | Finds the factors of a given number. |
- | I believe this was my first foray into |
- | programming. Not bad, eh? |
- +--------------------------------------------+
- | {!=} means not equal, {->} means Store, |
- | {sqrt} means square root, and {^2} means |
- | squared. These were used instead of the |
- | appropriate symbols due to the symbols |
- | not appearing correctly with some |
- | character sets and fonts. |
- +--------------------------------------------+
- | If you have a TI-83 at home, pull it out, |
- | make a new program, and enter this code. |
- +--------------------------------------------+
- :Lbl 0
- :Disp "ENTER THE NUMBER","THAT YOU WANT","THE FACTORS OF:":Input "",N
- :If round(N){!=}N
- :Goto 0
- :For(X,2,N/2)
- :N/X{->}Q
- :If round (Q,0)=Q:Then
- :Disp X
- :
- :If round({sqrt}(X),0)={sqrt}(X)
- :Disp "{^2}"
- :
- :Pause
- :End:End
- :Return
Advertisement
Add Comment
Please, Sign In to add comment