LCM and HCF of two numbers in C

This is a C program to calculate and print the LCM and HCF or GCD of two numbers.

Program takes two numbers as input from the user and then calculates their LCM and HCF.

Basic Mathematics required:

  • Euclid’s division Lemma and algorithm to find HCF or GCD(Greatest Common Divisor).
  • Relation between the numbers and their LCM and HCF.

Program: Find LCM and HCF in C


Enter two numbers: 15 25
LCM : 75 
HCF : 5

Share your code and queries in the comments.

Share this with your beginner friends.

Follow us on twitter.

About ᴾᴿᴼᵍʳᵃᵐᵐᵉʳ

Linux and Python enthusiast, in love with open source since 2014, Writer at, India.

View all posts by ᴾᴿᴼᵍʳᵃᵐᵐᵉʳ →

Leave a Reply

Your email address will not be published. Required fields are marked *