Hello

Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: How fast can your box identify prime numbers?  (Read 835 times)

Offline Mr. Kennedy
  • Resident Libertarian
  • Legendary Member
  • ******
  • Posts: 9110
  • Karma: +10/-0
How fast can your box identify prime numbers?
« Reply #15 on: January 28, 2003, 08:00:30 AM »
Actually this program is used for factors...

public class testloop2
{
   //Andrew Loomis      01-23-03
   //Project Name:      test-loop-2
   //This program is designed to find the factors from one to any positive
   //integer (n).
   
   public static void main(String args[])
   throws java.io.IOException
   {
      EasyReader Keyboard = new EasyReader();
      
      int n;
      char again;
      
      System.out.print("This program is designed to find the factors ");
      System.out.print("\\nfrom one up to and including a positive integer (n). ");
      
      do
      {   
         System.out.print("\\n\\nFind the factors from 1 to ");
         n = Keyboard.readInt();
         
         while (n <= 0)
         {
            System.out.print("\\nPlease enter a positive non-zero integer:  ");
            n = Keyboard.readInt();
         }
         
         System.out.print("\\n");
         
         for (int i = 1; i <= n; i++)
            if (n % i == 0)
               System.out.print(i + ", ");
         
         System.out.print("\\n\\nWould you like to use this program again?  ");
         again = Keyboard.readChar();
         Keyboard.readLine();
      }
      while ((again == \'Y\') || (again == \'y\'));
      
      System.out.print("\\n\\nThank you for using my program.");
   }
}
\"In the last 12 months 100,000 private sector jobs have been lost and yet you\'ve created 30,000 public sector jobs. Prime Minister, you cannot carry on forever squeezing the productive bit of the economy in order to fund an unprecidented engorgement of the unproductive bit. You cannot spend your way out of recession or borrow your way out of debt.\" - Daniel Hannan

Follow Me on Twitter!

Offline Avatarr
  • Wise Member

  • Hero Member
  • *****
  • Posts: 1647
  • Karma: +10/-0
    • http://www.sheepsheet.com
How fast can your box identify prime numbers?
« Reply #16 on: January 28, 2003, 03:27:37 PM »
a mod operation inside a for loop...
isn\'t that cute.

Offline Mr. Kennedy
  • Resident Libertarian
  • Legendary Member
  • ******
  • Posts: 9110
  • Karma: +10/-0
How fast can your box identify prime numbers?
« Reply #17 on: January 28, 2003, 04:34:53 PM »
well, I\'m still working on improvements.  I\'ll have better stuff in coming months.
\"In the last 12 months 100,000 private sector jobs have been lost and yet you\'ve created 30,000 public sector jobs. Prime Minister, you cannot carry on forever squeezing the productive bit of the economy in order to fund an unprecidented engorgement of the unproductive bit. You cannot spend your way out of recession or borrow your way out of debt.\" - Daniel Hannan

Follow Me on Twitter!

Offline Styx
  • Full Member
  • ***
  • Posts: 220
  • Karma: +10/-0
    • http://
How fast can your box identify prime numbers?
« Reply #18 on: January 28, 2003, 06:58:31 PM »
576 god i need a new pc. Come on tax return

Offline -____-
  • Hero Member
  • *****
  • Posts: 515
  • Karma: +10/-0
    • http://
How fast can your box identify prime numbers?
« Reply #19 on: January 30, 2003, 04:38:14 PM »
124 sec.

Offline Ace
  • Evil Klown
  • Legendary Member
  • ******
  • Posts: 2401
  • Karma: +10/-0
    • http://www.reprovideo.com
How fast can your box identify prime numbers?
« Reply #20 on: January 30, 2003, 04:51:38 PM »
104
www.lifesburning.com


There never has been a time when the power of America was so necessary or so misunderstood . . .
Tony Blair\'s Address to Congress

Offline Sublimesjg
  • La Rata Loco

  • Legendary Member
  • ******
  • Posts: 5776
  • Karma: +10/-0
    • http://
How fast can your box identify prime numbers?
« Reply #21 on: February 01, 2003, 04:54:49 AM »
201 not too bad but its a pos p3 1.0 so its to be expected
This Sig is a Work in Progress.
The Spaminators

Offline Bobs_Hardware

  • The ULTIMATE Badass
  • Legendary Member
  • ******
  • Posts: 9363
  • Karma: +10/-0
How fast can your box identify prime numbers?
« Reply #22 on: February 01, 2003, 06:24:00 AM »
131

 

SMF spam blocked by CleanTalk