answersLogoWhite

0

Based on gcd:

int LCM (int a, int b)

{

. int d= gcd (a, b);

. if (d==0) return 0;

. else return a/d*b;

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How can you find the Lowest common denominator of four integers?

lcm(a,b,c,d) = lcm(lcm(a,b,c),d) = lcm(lcm(a,b),lcm(c,d))


What is the LCM of 6 7 and C?

If C is co-prime with 6 and with 7, then LCM(6, 7, C) = 42*C If not, the answer depends on the value of C.


How can you make C programming on i3i5 processors?

Use a program called visual studio express. Its made by Microsoft and you can program in all kinds of languages. C , C+ etc


How you can make c program of attendance record system?

how can create a attendece sheet in c language


What is the LCM of 8 and C and C?

That would depend on the value of C.


How do you make an employee database in c program?

With lots of hard work.


Write a c program to find LCM of two numbers using recursion?

#include<stdio.h> #include<conio.h> void lcm(int m,int n) { for(i=1;i++) { if(i%m==0&&i%n==0) return i; } } void main() { clrscr(); int a,b; a=19;b=20; printf("lcm is %d",lcm(a,b)); getch(); }


What is the LCM of C and A?

If they have no common factors other than 1, the LCM is their product.


What does C mean in LCM?

The C stands for Common.


What is the LCM of A B and C?

That depends on the values of A, B and C.


Is that possible to make programme in turbo c for a mini computer having dual core processor-?

Yes, to make a program in Turbo C for a mini computer to have a dual core processor.


A program in C that accepts 15 different numbers and find the LCM and HCM?

/* To Get The LCM Of 15 Nos in C++/ C(Just Change cin to scanf & cout to printf) */ /* Developed By Kishore Kr. Banerjee - papillon_kish@yahoo.com*/ #include <iostream.h> #include <conio.h> main() { int num[15],i,j,n1,n2,LCM,flag; clrscr(); for(i=0;i<15;i=i+1) { cout<<"Enter No - "<<i+1<<"="; cin>>num[i]; } clrscr(); n1=num[0]; for(i=1;i<15;i=i+1) { n2=num[i]; LCM=1; for(j=1;n1%j==0n2%j==0;j=j+1) { if(n1%j==0) { n1=n1/j; flag=1; } if(n2%j==0) { n2=n2/j; flag=1; } if(flag==1) { LCM=LCM*j; } } LCM=LCM*n1*n2; n1=LCM; } cout<<"the LCM ="<<LCM; getch(); }