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

1. Write a function called printAr that will display the values in an array of i

ID: 3531958 • Letter: 1

Question

1. Write a function called printAr that will display the values in an array of integers. The function takes two arguments: an array of integers and an integer that represents the number of values to display. The function returns nothing.  

The strlen() function returns

(2 points) Which of the following is true of the arguments to strcat(s1, s2);? More than one answer may be correct so make sure to select all of the answers that apply.

(2 points) The strcmp function returns ____. More than one answer may be correct so make sure to select all of the answers that apply.

Explanation / Answer

1. Write a function called printAr that will display the values in an array of integers. The function takes two arguments: an array of integers and an integer that represents the number of values to display. The function returns nothing.

void printAr(int a[], int k)
{
cout << " array elements are";
for(int i=0; i<k;i++)
cout << a[i] << " " ;
cout << endl;
}

The strlen() function returns
the number of chars in an array of char not including the null


(2 points) Which of the following is true of the arguments to strcat(s1, s2);? More than one answer may be correct so make sure to select all of the answers that apply.
both s1 and s2 must be valid strings
s1 must have room to contain the result


(2 points) The strcmp function returns ____. More than one answer may be correct so make sure to select all of the answers that apply.

0 if the two strings are equal
a negative value if the first argument is alphabetically less than the second
a positive value if the first argument is alphabetically greater than the second

all are correct.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote