This program considers x and y as input.If either of the two number
is 0 then the LCM is 0.For finding LCM,temporary variables x1 and
y1 are used whcih stores the vaue of x and y respectively.Both the
numbers x and y are compared with each other and the respective
temporary variable is added in the smaller number.This process continous
until the number are equivalent to each other.When both the numbers
are equivalent then x is **LCM of two numbers**.

#include < stdio.h > #include < conio.h > void main() { int x,y,x1,y1; clrscr(); printf("\nEnter two numbers :"); scanf("%d %d",&x,&y); x1=x; y1=y; if(x==0 || y==0) printf("\n LCM is 0"); else { while(x!=y) { if(x>y) y=y+y1; else if(x < y ) x=x+x1; } printf("\n LCM is %d",x); } }