Advertisement
sweet1cris

Untitled

Jan 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.17 KB | None | 0 0
  1.     public void gcd() {
  2.         int a = 147, b = 105;
  3.         while (a != b) {
  4.             if (a > b) {
  5.                 a -= b;
  6.             } else {
  7.                 b -= a;
  8.             }
  9.         }
  10.         System.out.println("GCD is " + a);
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement