Professional Documents
Culture Documents
while(true)
{
if(max%n1==0&&max%n2==0)
{
return (max);
}
++max;
}
int main()
{
int a[20];
int i,n,num ;
cout<<"Enter the number of element work on: "<<endl;
cin>>n;
for(i=0;i<n;i++)
{
int p;
cout<<"Enter the number for a["<<i<<"] is ";
cin>>p;
}
num=sizeof(a)/sizeof(a[0]);
cout<<"lcm of array is ="<<lcm_a(a,num);