![]() |
The gmp_lcm() is an inbuilt function in PHP that is used to calculate the least common multiple (LCM) of two or more integers. Syntax: gmp_lcm(GMP|int|string $num1, GMP|int|string $num2): GMP
Parameters: This function accepts two parameters that are described below.
Return Values: The gmp_lcm() function returns the lcm of two integers which is provided by the user. Program 1: The following program demonstrates gmp_lcm() function. PHP
Output: LCM of 12 and 18 is: 36
Program 2: The following program demonstrates gmp_lcm() function. PHP
Output: LCM of 12, 18, and 24 is: 72
Reference: https://www.php.net/manual/en/function.gmp-lcm.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |