Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Students: This content is controlled by your instructor, and is not zyBooks cont

ID: 3595638 • Letter: S

Question

Students: This content is controlled by your instructor, and is not zyBooks content Direct questions or concerns about this content to instructor. If you have any technical issues with the zyLab submission system, use the 1 rouble with lab button at the botto 7.8 Loop/Array Test Practice 2 ACTNITY 781.Loop/Array Test Practice 2 This toor is provided by & third party Your activity is aways recordes but you may need to refresh the page to fhe in the banner Loop/Array Test Practice 2 wwne a function t shouid look thwough an aray and sum all of the numbers thatl are mufiples of mutiple. If there are no muitiples of hat has two inguts, an array catled array and an integer mutpie, and one output, an integer summation Your program muitiple, return o For example, if you function look the irpus array-1123456769 10 0mcat tut you .ne me banen fre tons terrem") ce mot m nito ted the rernande, of re dretsion mvn.. 0 Type here to search

Explanation / Answer

save this in file summationMultiple.m

function sumM = summationMultiple(arr, mult)
sumM = 0;
n = size(arr, 2)
for i=1:n
if ~mod(arr(i),mult)
sumM += arr(i);
end
end
end

run this in console

fprintf("Summation: %d", summationMultiple([1 2 3 4 5 6 7 8 9 10], 5))

Samle output

Summation: 15

# code link: https://paste.ee/p/A8LLE

Please comment if this is needed in any other programming language and I will make the change.