Answer:
The code is given as follows,
Explanation:
Code:
#include <stdio.h>
#include <string.h>
int n; //to store size of array
char* ArrayChallenge(int arr[]) //function returns string true or false
{
int i, j;
int sum = 0;
for(i = 0; i < n; i++)
{
sum = sum + arr[i]; //count sum
}
for(i = 0; i < n; i++)
{
for(j = i+1; j < n; j++) //loop for every two elements in array
{
if(arr[i]*arr[j] > 2*sum) //check if proudct of two elements > 2 times sum
{
printf("\n%d x %d = %d, 2xSum = %d\n", arr[i], arr[j], arr[i]*arr[j], 2*sum);
return "true"; //If proudct of two elements > 2 times sum. return true
}
}
}
return "false"; // If proudct of two elements < 2 times sum. return false
}
int main()
{
printf("\nEnter size of array: ");
scanf("%d", &n); //read size of array
int A[n]; //array of size n
printf("\nEnter array elements: ");
int i;
for(i = 0; i < n; i++)
{
scanf("%d", &A[i]); //read array from stdin
}
printf("%s\n",ArrayChallenge(A)); //ccall function and print answer
return 0;
}