Introduction
I have used Code::blocks 12 compiler for debugging purpose. But you can use any C programming language compiler as per your availability.
I have used Code::blocks 12 compiler for debugging purpose. But you can use any C programming language compiler as per your availability.
#include <stdio.h>
// Function declaration
int Findlcm(int x, int y);
int main()
{
int num1, num2, LCM;
// Inputting two numbers from user
printf("Enter any 2 numbers to find LCM: ");
scanf("%d%d", &num1, &num2);
if(num1 > num2)
LCM = Findlcm(num2, num1);
else
LCM = Findlcm(num1, num2);
printf("LCM of %d and %d = %d", num1, num2, LCM);
return 0;
}
int Findlcm(int x, int y)
{
static int multiple = 0;
// Increments multiple by adding max value to it
multiple += y;
if((multiple % x == 0) && (multiple % y == 0))
{
return multiple;
}
else
{
return Findlcm(x, y);
}
}
Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …
C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …