This C program compares two distinct arrays and if the arrays are same then content results in FALSE. The behavior of comparison is explained when we note that the comparison is a comparison of addresses, not contents.

Comparing Arrays by Addresses

Comparing Arrays by Addresses

In this updated code, we added a loop to compare each element of arrays a and b. If any pair of corresponding elements is not equal, the equal variable is set to 0, indicating that the arrays are not equal. The result is then printed based on the value of the equal variable.