Bool isSymmetric(int a[],int n) ;
The function returns true if and only if the array obtained by reversing the first n elements is the same as the original array.For example,if a is{22,33,44,55,44,33,22} then te call isSymmetric(a,7) would return true,but the call isSymmetric (a,4) would return false.
Bool isSymmetric(int a[], int n) ;
The function returns true if and only if the array obtained by reversing the first n elements is the same as the original array. For example,if a is{22,33,44,55,44,33,22} then the call isSymmetric(a,7) would return true,but the call isSymmetric (a,4) would return false.
sorry i have the first part of question which i understood already,but ı dont know second part is true or not this is the missing first part of question :void reverse(int a[],int n);
The function reverses the first n elements of the array.For example,the call reverse(a,5) would transform the array {22,33,44,55,66,77,88,99} into {66,55,44,33,22,77,88,99}.
The function reverses the first n elements of the array. For example,the call reverse(a,5) would transform the array {22,33,44,55,66,77,88,99} into {66,55,44,33,22,77,88,99}.
1 2 3 4 5 6 7 8 9 10 11
void reverseArray(int a[], int n)
{
int i;
int temp;
for(i = 0; i < n / 2; i++)
{
temp = a[i];
a[i] = a[n-i-1];
a[n-i-1] = temp;
}
}