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

1 Answer

0 votes
#include <stdio.h>

int main(void) {
    int num1 = 81;
    int num2 = 9;

    printf("%s", (num1 % num2 == 0) ? "yes" : "no");

    return 0;
}




/*
run:

yes

*/

 



answered Jun 28, 2022 by avibootz

Related questions

1 answer 125 views
1 answer 147 views
1 answer 120 views
1 answer 315 views
1 answer 121 views
1 answer 111 views
1 answer 127 views
...