C Program to Find the GCD and LCM of Two Integers1 min read

The post on C program calculates the GCD and LCM of two integer numbers.

GCD(Greatest Common Divisor) or HCF: Largest Integer that can divide both the numbers without any remainder or with 0 as remainder. For example, the GCD or HCF of 36 and 48 is 12.

LCM(Least Common Multiple): The LCM of two integers is the smallest positive integer that is perfectly divisible by both the numbers (without a remainder). For example, the LCM of 16 and 24 is 48.


C Program to find HCF and LCM of two Integer Number

Output:


C Program to find HCF and LCM using Recursion

Learn more on recursion.

Output:


MORE

C++ Structures

In the C/C++ programming language, the structure is user-defined data types that allow us to store the combination of different data types together. All the …
Read More

C++ Static Keyword

Static s a keyword in C++ that is when used with different types gives different meanings. static keyword can be used with variables in a …
Read More

C++ Templates

Templates in C++ are the powerful feature that allows us to write generic programs (generic classes and generic functions). A single class or function is …
Read More

C++ Friend Function

There are private and protected members in a class that is inaccessible from outside of the class, constituting one of the concepts of object-oriented programming …
Read More

this Pointer in C++

In C++, this is a keyword that refers to the current instance of a class and this pointer holds the address or points to the …
Read More

Inheritance in C++

Inheritance is one of the most important concepts of object-oriented programming. In C++, inheritance is the process of deriving the properties and behaviors of one …
Read More