Answer:
#include <iostream>
int isreverse(int a[], int b[], int size)
{
for (int i = 0; i < size; i++) {
if (a[i] != b[size - i - 1])
{
return 0;
}
}
return 1;
}
int main()
{
int first[] = { 2, 5, 7, 8, 15 };
int second[] = { 15, 8, 7, 5, 2};
int third[] = { 1, 2, 3, 4, 5 };
printf("First is %sthe reverse of second.\\", isreverse(first, second, 5) ? "": "NOT ");
printf("Second is %sthe reverse of third.\\", isreverse(second, third, 5) ? "" : "NOT ");
}
Step-by-step explanation:
Assuming you are looking for a C/C++ solution...