diff --git a/SOLUTIONS/asciiproduct_1.cpp b/SOLUTIONS/asciiproduct_1.cpp new file mode 100644 index 00000000..952e8d59 --- /dev/null +++ b/SOLUTIONS/asciiproduct_1.cpp @@ -0,0 +1,23 @@ + +long long productAscii(string str) +{ + long long prod = 1; + + // Traverse string to find the product + for (int i = 0; i < str.length(); i++) { + prod *= (int)str[i]; + } + + + return prod; +} + + +int main() +{ + string str = "payal"; + + cout << productAscii(str); + + return 0; +}