Program to find the product of ASCII values of characters in a string | C # program to find product of ASCII value of characters in string ; Function to find product of ASCII value of characters in string ; Traverse string to find the product ; Return the product ; Driver Code
using System ; class GFG { static long productAscii ( String str ) { long prod = 1 ; for ( int i = 0 ; i < str . Length ; i ++ ) { prod *= str [ i ] ; } return prod ; } static public void Main ( ) { String str = " GfG " ; Console . Write ( productAscii ( str ) ) ; } }