int z;
for(z=y+1;lcm(x,z)>=lcm(x,y);z++);
printf("%d",z);
try this code. the for loop will search for the correct z and quit only when it finds. hope u have the lcm function.
luv
Karthik.
LOL A ship is safe in the harbour, but that's not what it is meant for!!! LOL