How to check if one number is multiple of another in C++

1 Answer

0 votes
#include <iostream>

int main() {
    int num1 = 121;
    int num2 = 11;

    std::cout << (num1 % num2 == 0 ? "yes" : "no");

    return 0;
}




/*
run:

yes

*/

 



answered Jun 28, 2022 by avibootz

Related questions

1 answer 95 views
1 answer 136 views
1 answer 112 views
1 answer 306 views
1 answer 111 views
1 answer 106 views
1 answer 116 views
...