#include
#include
void main()
{
clrscr();
int n,a[100],m=1,d,i,max,lcm;
printf("How many number u have:");
scanf("%d",&n);
printf("enter numbers:");
for(i=0;i
scanf("%d",&a[i]);
max=a[0];
for(i=1;i
{
if(max
max=a[i];
}
lcm=max;
b:
for(i=0;i
{
if(lcm%a[i]!=0)
{
m++;
lcm=max*m;
goto b;
}
}
printf("LCM=%d",lcm);
getch();
}
0 comments:
Post a Comment