#include<stdio.h>
int Lcm(int a,int b);
int main(){
int a,b,Lcm;
printf("Please Enter Two Number: ");
scanf("%d%d",&a,&b);
if(a>b)
Lcm = lcm(a,b);
else
Lcm = lcm(b,a);
printf("LCM of %d and %d is:%d",a,b,Lcm);
return 0;
}
int lcm(int a,int b){
static int temp = 1;
if(temp % a == 0 && temp % b == 0)
{
return temp;
}
temp++;
lcm(a,b);
}
No comments:
Post a Comment