Question: URGENT! Write code for a function that finds all of the multiples of a number n. The function stores each multiple in an array of

URGENT!

Write code for a function that finds all of the multiples of a number n. The function stores each multiple in an array of size 100 and updates num_multiples so that it stores the current number of multiples found. The range of n should be from 1 - 100.

Function prototype:

void findMultiples(int n, int arra[], int& num_multiples);

To test the function ask the user for a number n from 1 to 100 (make sure to check the input and keep asking for the input until a value in the correct range is inputted), and then display the contents of the array.

Sample run:

Enter a number 6 6 has the multiples: 1, 2, 3, 6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!