Write a c program to find the sum of max and next max in a given array. for example int arr[]={2,5,68,2,4,32} The largest element is 68 and after this 32 is next largest them sum these two largest which is 68 + 32 = 100.


/*comparator for quick sort*/
int comp(const void* a,const void* b)
    const int *x = (const int*)a;
    const int *y = (const int*)b;
    return (*y - *x);
void    print(int arr[],int size);
int main()

    int arr[]={2,5,68,2,4,32};
        int size = sizeof(arr)/sizeof(arr[0]);
    /*quick sort arr*/
        printf("The Sum is %d \n",arr[0] + arr[1]);
return 0;
void    print(int arr[],int size)
    int i=0;
    printf("%d ",arr[i]);

Related Contents to follow