The LCM is: 3,411,975
Chat with our AI personalities
2037 7 is UNITS 3 is TENS 0 is HUNDREDS 2 is THOUSANDS. Are the column numbder names for the given digits.
1675
335
/* 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(); }
2