Sum of all prime numbers in an Array
Given an array arr[] of N positive integers. The task is to write a program to find the sum of all prime elements in the given array. Examples: Input: arr[] = {1, 3, 4, 5, 7} Output: 15 There are three primes, 3, 5 and 7 whose sum =15. Input: arr[] = {1, 2, 3, 4, 5, 6, 7} Output: 17 Naive Approach: