int count_multiples(int (&array)[100]) { int result = 0; bool multipleFound;
for (int b = 0; b < 96; b++) { multipleFound = true; for (int num = 2; num <= 5; num++) if (array[b + num - 2] != num) { multipleFound = false; break; }
if (multipleFound) result++; else b += 3; } }
int main() { int array[100]; fill_array(array); print_array(array);
cout << "The number of multiples of {2, 3, 4, 5} found: " << count_multiples(array) << endl;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment