You need to sign in or sign up before continuing.×
Retired

Find the GCF of Two Numbers (retired)

354 of 1,169Shadows of Time

Description:

Your task here is the find the GCF (Greatest Common Factor) of any two numbers passed into a method, which will return one integer answer as an output.

Examples:

findGCF(4, 6); // Should return 2
findGCF(93, 186); // Should return 93
findGCF(20, 5); // Should return 5
find_GCF(4, 6) # Should return 2
find_GCF(93, 186) # Should return 93
find_GCF(20, 5) # Should return 5
findGCF(4, 6); // Should return 2
findGCF(93, 186); // Should return 93
findGCF(20, 5); // Should return 5
FindGCF(4, 6); // Should return 2
FindGCF(93, 186); // Should return 93
FindGCF(20, 5); // Should return 5
findGcf 2 4  -- Should return 2
findGcf 8 20 -- Should return 4
findGcf 5 13 -- Should return 1
find_GCF(4, 6) # Should return 2
find_GCF(93, 186) # Should return 93
find_GCF(20, 5) # Should return 5

Here, inputs will always be natural numbers so there's no need to worry about negative values or zero.

Algorithms
Logic
Numbers
Data Types
Mathematics

Stats:

CreatedJul 31, 2016
Warriors Trained1635
Total Skips47
Total Code Submissions2443
Total Times Completed1169
Java Completions354
Python Completions395
C++ Completions337
C# Completions104
Haskell Completions67
Ruby Completions17
Total Stars9
% of votes with a positive feedback rating84% of 275
Total "Very Satisfied" Votes202
Total "Somewhat Satisfied" Votes60
Total "Not Satisfied" Votes13
Ad
Contributors
  • Shadows of Time Avatar
  • suic Avatar
  • DanWaxman Avatar
  • user5036852 Avatar
  • Voile Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
Ad