multiples.c 521 Bytes
#include <stdio.h>
int main() {
int i[6];
int d3 = 0,
d7 = 0,
d21 = 0;
printf("Six integers: ");
scanf("%d %d %d %d %d %d", i, i+1, i+2, i+3, i+4, i+5);
for (int j = 0; j < 6; j++) {
int each = i[j];
if (each % 21 == 0) {
d3++; d7++; d21++;
}
else if (each % 3 == 0) {
d3++;
}
else if (each % 7 == 0) {
d7++;
}
}
printf("%d divisible by 3,\n%d divisible by 7,\n%d divisible by both.\n", d3, d7, d21);
return 0;
}