java ,program

From: Benjamin (ben_torres_at_msn.com)
Date: 09/28/04


Date: 28 Sep 2004 10:19:00 -0700

I NEED TO Write a program that meets the following requirements:
 
Declare a method to determine whether an integer is a prime number.
Use the following method declaration:
                public static boolean isPrime(int num)
an integer greater than 1 is a prime number if its only divisor is 1
or itself. For example, isPrime(11) returns true, and isPrime(9)
returns false.
 
Use the isPrime method to find the first five hundred prime numbers
and display every ten prime numbers in a row, as follows:
 
2 3 5 11 13 17 19 23 29
31 37 41 43 47 53 59 61 67
73 79 83 89 97.....etc



Relevant Pages

  • Re: help urgent
    ... Declare a dynamic array of stuctures. ... > in the event handler should display an OpenFileDialog allowing the user ... load the date from each array member into the combo box. ...
    (microsoft.public.vb.general.discussion)
  • Re: Where to declare Variables
    ... the input fields have php variables to display the ... Now to prevent notice warning for the variable I set it in the ... first it is a good practice to declare the variables before using them. ... The problem you describe sounds like a Zend IDE problem. ...
    (comp.lang.php)
  • Re: Where to declare Variables
    ... the input fields have php variables to display the ... Now to prevent notice warning for the variable I set it in the ... first it is a good practice to declare the variables before using them. ... The problem you describe sounds like a Zend IDE problem. ...
    (comp.lang.php)
  • Why do I receive no value error message, when parameters do have v
    ... ' Declare the ADO variable for the tbl_Referral_Data recordset ... Dim rstbl_RefSEN As New ADODB.Recordset ... ' Select the required data from tbl_Referral_Data and display the SEN data ...
    (microsoft.public.access.modulesdaovba)
  • Re: Where to declare Variables
    ... To minimize the actual php code on this page I include all the ... the input fields have php variables to display the ... Now to prevent notice warning for the variable I set it in the ... first it is a good practice to declare the variables before using them. ...
    (comp.lang.php)