Company: wipro_7nov
Difficulty: medium
Find sum of all prime numbers in the array, except the largest prime number Description You are given an array of input2 integers called input1 . Add up every prime number in the array, but leave out the largest prime. If the largest prime appears more than once, only one of its occurrences is left out - the others still count. If the array holds no prime at all, fall back to the same rule applied to the whole array: add up every element except the largest one, again dropping only a single occurrence of it. A prime is an integer greater than 1 whose only positive divisors are 1 and itself. Negative numbers, 0 and 1 are not prime. Function Complete the function findSumOfPrimes : int findSumOfPrimes(int input1[], int input2) input1 - the array of numbers. input2 - the number of elements in input1 . It returns the required sum. Input Format The first line contains the integer input2 , the number of elements. The second line contains input2 space separated integers, the elements of input1