The smallest number that divide in 13, 15, and 17 with C++

2 Answers

0 votes
#include <iostream>
#include <numeric> // For std::lcm (C++17 and above)

int main() {
    int a = 13, b = 15, c = 17;

    // Calculate LCM of three numbers
    int lcm_ab = std::lcm(a, b); // LCM of 13 and 15
    int lcm_abc = std::lcm(lcm_ab, c); // LCM of (13, 15) and 17

    std::cout << "The smallest number that divides 13, 15, and 17 is: " << lcm_abc << std::endl;
}


/*
run:

The smallest number that divides 13, 15, and 17 is: 3315

*/

 



answered Nov 5, 2025 by avibootz
0 votes
#include <iostream>

int main() {
    int a = 13, b = 15, c = 17;

    int num = a * b * c;

    std::cout << "The smallest number that divides 13, 15, and 17 is: " << num << std::endl;
}


/*
run:

The smallest number that divides 13, 15, and 17 is: 3315

*/

 



answered Nov 5, 2025 by avibootz

Related questions

1 answer 75 views
1 answer 198 views
1 answer 197 views
197 views asked Apr 22, 2022 by avibootz
1 answer 129 views
1 answer 242 views
...