Answers
As per Chegg policy we are supposed to answer only first question. Request you to post other question separately.
#include <stdio.h>
int main(){
int num[30]; //maximum 30 numbers can be stored
int i, j;
int count;
int symmetric = 1; //assume to be symmetric
printf("How many numbers to be in array? ");
scanf("%d", &count);
printf("Enter the numbers: ");
for(i = 0; i < count; i++)
scanf("%d", &num[i]);
i = 0;
j = count - 1; //last array element
while(i < j){
if(num[i] != num[j])
{
symmetric = 0;
break;
}
i++;
j--;
}
if(symmetric)
printf("The array is symmetric\n");
else
printf("The array is not symmetric\n");
}
output
------
How many numbers to be in array? 7
Enter the numbers: 1 2 3 4 3 2 1
The array is symmetric
How many numbers to be in array? 6
Enter the numbers: 1 2 3 3 2 1
The array is symmetric
How many numbers to be in array? 7
Enter the numbers: 1 2 3 4 5 6 7
The array is not symmetric