testing lcm in cpp