📜  c++代码示例中的bool函数

📅  最后修改于: 2022-03-11 14:44:51.912000             🧑  作者: Mango

代码示例3
bool Divisible(int a, int b) {
    int remainder = a % b; // Calculate the remainder of a and b.

    if(remainder == 0) {
        return true; //If the remainder is 0, the numbers are divisible.
    } else {
        return false; // Otherwise, they aren't.
    }
}