JamesTheAwesomeDude

TI-83 Factoring program

Feb 18th, 2013
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. +--------------------------------------------+
  2. | Originally written on a TI-83 calculator. |
  3. | Finds the factors of a given number. |
  4. | I believe this was my first foray into |
  5. | programming. Not bad, eh? |
  6. +--------------------------------------------+
  7. | {!=} means not equal, {->} means Store, |
  8. | {sqrt} means square root, and {^2} means |
  9. | squared. These were used instead of the |
  10. | appropriate symbols due to the symbols |
  11. | not appearing correctly with some |
  12. | character sets and fonts. |
  13. +--------------------------------------------+
  14. | If you have a TI-83 at home, pull it out, |
  15. | make a new program, and enter this code. |
  16. +--------------------------------------------+
  17.  
  18. :Lbl 0
  19. :Disp "ENTER THE NUMBER","THAT YOU WANT","THE FACTORS OF:":Input "",N
  20. :If round(N){!=}N
  21. :Goto 0
  22. :For(X,2,N/2)
  23. :N/X{->}Q
  24. :If round (Q,0)=Q:Then
  25. :Disp X
  26. :
  27. :If round({sqrt}(X),0)={sqrt}(X)
  28. :Disp "{^2}"
  29. :
  30. :Pause
  31. :End:End
  32. :Return
Advertisement
Add Comment
Please, Sign In to add comment