Statistics

Problem Statement for "PrimeFinder"

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)

Constraints

    Examples


      This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
      This problem was used for: