Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program to check if a number is prime in TIBASIC
#1
Sorry, I could't get it to work for 2, 3, 5, or 7. But Honestly you should know those anyways O.o
Other than that, It works pretty well from what I've tested. This was tested on the TI-84+ Silver Edition

Code:
ClrHome
Input "Number: ",A
A/2→C
A/3→D
A/4→E
A/5→F
A/6→G
A/7→H
A/8→I
A/9→J
If iPart(C)*2=A or iPart(D)*3=A or iPart(E)*4=A or iPart(F)*5=A or iPart(G)*6=A or iPart(H)*7=A or iPart(I)*8=A or iPart(J)*9=A
Then
ClrHome
Disp "Not Prime"
Else
ClrHome
Disp "Prime"
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Amazon Prime Phone number +1-888-336-4555 17jameszoe 0 440 11-11-2019, 04:45 AM
Last Post: 17jameszoe

Forum Jump:


Users browsing this thread: 1 Guest(s)