Question: question 1: int func(int arr1[], int arr2[], int size) { int count = 0; for (int i=0; i
question 1:
int func(int arr1[], int arr2[], int size)
{ int count = 0; for (int i=0; i { if (arr1[i] != arr2[i]) count++; } return count; } Given the function definition above, what value will the following code print out? int nums1[] = {1,2,3,4}; int nums2[] = {4,7,3,2}; cout << func(nums1, nums2, 4) << endl; question 2: int func (int* numPtr, int val) { int temp = *numPtr; *numPtr = val * 2; return temp; } Given the above function definition, what will the following code print out? int num1 = 3; int num2 = 1; int num3 = func (&num1, num2); cout << num3 << ", " << num2 << ", " << num1 << endl;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
