JavaScript program to find HCF (GCD) of two numbers || Hindi Tutorial

Поділитися
Вставка
  • Опубліковано 19 жов 2024
  • Write a JavaScript program input two numbers from user and find the HCF using for loop. How to find GCD of two given numbers using loops in JavaScript programming. Logic to find HCF of two number in JavaScript programming.
    Example
    Input
    Input first number: 12
    Input second number: 30
    Output
    HCF of 12 and 30 : 6
    What is HCF?
    HCF (Highest Common Factor) is the greatest number that divides exactly two or more numbers. HCF is also known as GCD (Greatest Common Divisor) or GCF (Greatest Common Factor).
    Required knowledge
    Basic JavaScript programming, Conditional operator, If else, For loop
    Thank's For Watching This Video
    Like Share Subscribe

КОМЕНТАРІ • 7