TopcoderArchiveVisit Topcoder
Archive
Algorithm problem

GCF

Problem statement, definition, constraints, and public examples.

Problem Statement

In math, the Greatest Common Factor (GCF) between two numbers is greatest
number that both numbers can evenly be divided by. For example, the GCF between
54 and 24 is 6. You need to create a class GCF containing the method Factor,
taking two ints and return the greatest common factor between them. Here is the
method signature: 

int Factor (int a, int b);

Definition

Class:
GCF
Method:
Factor
Parameters:
int, int
Returns:
int
Method signature:
int Factor(int param0, int param1)
(be sure your method is public)

Constraints

    Examples

      No public sample cases were explicitly marked for this problem in the original data.

      Back to all problems