About 4,850,000 results
Open links in new tab
  1. Java Program to Find Greatest of Two Numbers - PrepInsta

    Given two integer inputs N1 and N2, the objective is to write a code to Find the Greatest of the Two Numbers in Java. In order to do so we’ll compare the numbers using if-else statements.

  2. Java Program to Compute GCD - GeeksforGeeks

    Apr 4, 2025 · GCD (Greatest Common Divisor) of two given numbers A and B is the highest number that can divide both A and B completely, i.e., leaving the remainder 0 in each case. …

  3. Java Program to Find GCD of two Numbers

    In this program, you'll learn to find GCD of two numbers in Kotlin. This is done by using for and while loops with the help of if else statements.

  4. Java Program to Find GCD of Two Numbers - Tpoint Tech

    In this section, we have covered different logics in Java programs to find GCD of two numbers. Greatest Common Divisor: It is the highest number that completely divides two or more …

  5. Java Program to Find GCD or HCF of Two Numbers

    Mar 28, 2021 · GCD (i.e. Greatest Common Divisor) or HCF (i.e. Highest Common Factor) is the largest number that can divide both the given numbers. Example: HCF of 10 and 20 is 10, and …

  6. java - How to find GCD, LCM on a set of numbers - Stack Overflow

    Jun 29, 2016 · I've used Euclid's algorithm to find the greatest common divisor of two numbers; it can be iterated to obtain the GCD of a larger set of numbers. while (b > 0) long temp = b; b = a …

  7. 4 Methods To Find GCD Of Two Numbers In Java (+Code …

    This article explains various methods to find the GCD of two numbers in Java, including loops, recursion, Euclidean algorithm, and Java's built-in gcd() method.

  8. Find GCD or HCF of Two Numbers in Java - Online Tutorials …

    Learn how to find the GCD (Greatest Common Divisor) or HCF (Highest Common Factor) of two numbers in Java with this step-by-step guide. Discover how to calculate the GCD or HCF of …

  9. Find the Greatest of the Two Numbers in Java - Python4U

    Dec 16, 2023 · there are few ways to find the largest or greatest of two numbers in java: Method 1: Using if-else Statements; Method 2: Using Ternary Operator; Method 3: Using inbuilt …

  10. Java Program to Find Largest of Two Numbers - CodesCracker

    Largest of Two Numbers using Function. This program uses a user-define function named LargestOfTwo(), that takes two numbers as its two arguments and returns the largest between …

Refresh