Euclidean algorithm (GDC)

function gcd(a, b)
    while ab 
        if a > b
            a := ab
        else
            b := ba
    return aCode language: JavaScript (javascript)

Lets write a program to find the greatest common divisor!

  1. Go into GitHub
  2. Create a new project “GCD”
  3. Click “Create Readme.md”
  4. In terminal go to ruby workspace, and clone new repository
  5. Open in VS Code
  6. Develop and run code
  7. Commit and save from command line
  8. (Later we will learn to do git from VS Code)

Scroll to Top