int lcm(int a, int b) { // static variable static int common = 0; // add largest number common += b; // base case if(common%a == 0) return common; // general case else return lcm(a, b); }