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

I need help with this c++ code. It should look something like void printArray (i

ID: 3680801 • Letter: I

Question

I need help with this c++ code. It should look something like void printArray (int s[], int m) { int n; for (n=0; n<m; n++) count << s[] << endl; } But it says that isn't right but I know it should look something close to that. Write the definition of a function printArray, which has two parameters. an int, the number of elements in the array. The function does not return a value The function prints out each element of the array on a lin The first parameter is an array of integers and the second is e by itself, in the order the elements appear in the array, and does not print anything else.

Explanation / Answer

This is your modified code

void printArray(int s[],int m)

{

int   n;

for(n=0;n<m;n++)

cout<<s[n]<<endl; //in your given code you wrote keyword cout as count and empty brackets followed by array   

                             //you have to specify it as nth element of array as s[n].

}