Prime Numbers from 2 to 50,021. - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Programs (https://staging.qb64phoenix.com/forumdisplay.php?fid=7) +---- Thread: Prime Numbers from 2 to 50,021. (/showthread.php?tid=611) |
Prime Numbers from 2 to 50,021. - SierraKen - 07-13-2022 B+ mentioned prime numbers in my "Make Shapes" thread so I decided to see how I could make a long list of them. I tried a few times on my own but I couldn't figure it out so I found code on a QBasic page on Google. I added the URL in the code. Their page only lets people type a number to see if it's a Prime Number or not so I just listed them with the same code pretty much and added a bit of my own. When it almost fills up a page, it asks if you want to see more which you can do so by pressing the Space Bar, or Esc to quit. It ends at 50,021. I noticed my computer slows down a little bit in the 40,000 range. Am not sure why it does that since I dimmed the number as a double and put the _LIMIT at 3000. Anyway, enjoy the numbers. Code: (Select All) 'Prime Numbers up to 50,021. |