Question
We have two arrays A and B, each with 10 integers. Write afunction that tests if every element in array A is equal to itscorresponding element in array B. The function is to return true ifall elements are equal and false if at least one element is notequal. We have two arrays A and B, each with 10 integers. Write afunction that tests if every element in array A is equal to itscorresponding element in array B. The function is to return true ifall elements are equal and false if at least one element is notequal.
Explanation / Answer
please rate - thanks #include #include int compare(int[],int[]); int main() {int a[10]={1,2,3,4,5,6,7,8,9,0}; int b[10]={1,2,3,4,5,6,7,8,9,5}; if(compare(a,b)) printf("the 2 arrays are the same "); else printf("the 2 arrays are not thesame "); getch(); return 0; } int compare(int a[],int b[]) {int i; for(i=0;i