Sum of each element raised to ( prime | C # implementation of the approach ; Function to return the required sum ; Driver code
using System ; public class GFG { public static int getSum ( int [ ] arr , int p ) { return arr . Length ; } static public void Main ( ) { int [ ] arr = { 5 , 6 , 8 } ; int p = 7 ; Console . WriteLine ( getSum ( arr , p ) ) ; } }