Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 2019/12/22(日)
- // 3、7、21の倍数の表示
- #include <stdio.h>
- int main(void) {
- for (int i = 1; i <= 100; i++) {
- if ((i % 3 == 0) && (i % 7 == 0)) {
- printf("%dは21の倍数\n", i);
- } else if (i % 3 == 0) {
- printf("%dは3の倍数\n", i);
- } else if (i % 7 == 0) {
- printf("%dは7の倍数\n", i);
- } else {
- ;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement