TopCoder problem "PrimeFinder" used in SRM 19 (Division I Level One , Division II Level One)



Problem Statement

    
Class name: PrimeFinder
Method name: getPrime
Parameters: int
Returns: int

Implement a class PrimeFinder that contains the method getPrime.  getPrime
takes an integer x as a parameter and returns the smallest prime number greater
than x.

*For this problem, a prime number is defined as any nonnegative integer with
only two unique nonnegative divisors: itself and 1.

The method of the signature is:
public int getPrime (int x);

*x must satisfy 0 <= x <= 1000000.

Examples:
-If x=6, then the method should return 7.
-If x=13, then the method should return 17.

 

Definition

    
Class:PrimeFinder
Method:getPrime
Parameters:int
Returns:int
Method signature:int getPrime(int param0)
(be sure your method is public)
    

Problem url:

http://www.topcoder.com/stat?c=problem_statement&pm=128

Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=3018&pm=128

Writer:

doeth

Testers:

Problem categories: