This is the code I wrote. Please tell me the mistakes and knowledge gap I may have
#include <stdio.h>
int main()
{
int i,n,c=1;
printf("enter the number 1:");
scanf("%d",&i);
printf("enter the second number:");
scanf("%d",&n);
while (i!=n)
{
c++;
i=i*c;
n=n*c;
}
printf("the lcm is %d",i);
return 0;
}
Input I put: 2 & 3
The output I get: The lcm is 0
Output expected: The lcm is 6