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)
  • 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: win32 dll vb.net pointers receiving data - HELP
    ... > Declare Function GetTheData Lib "scandll.dll" (ByVal msg As ... > StringBuilder, ByRef msgLength As IntPtr) As Integer ... > length is displayed as 204430, but when I display the IntPtr.ToInt32, I ... The demo code they supplied is in C++ so it doesn't have this ...
    (microsoft.public.dotnet.languages.vb)
  • Re: DrawText question
    ... Now the texts don't display at all. ... In what format does the string have to be to work with this declare? ... ByRef lpRect As RECT, ByVal wFormat As Long) As Long ...
    (microsoft.public.vb.winapi)
  • win32 dll vb.net pointers receiving data - HELP
    ... Declare Function GetTheData Lib "scandll.dll" (ByVal msg As ... StringBuilder, ByRef msgLength As IntPtr) As Integer ... length is displayed as 204430, but when I display the IntPtr.ToInt32, I ... The demo code they supplied is in C++ so it doesn't have this ...
    (microsoft.public.dotnet.languages.vb)