> For the complete documentation index, see [llms.txt](https://docs-57.gitbook.io/data-structure-and-algorithms/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-57.gitbook.io/data-structure-and-algorithms/problems/string/multiply-strings.md).

# Multiply Strings

string s1 = "123"; string s2 = "45";

Result= 5535

```csharp
public class Program
{
    

    public int MultiplyStrings(string s1, string s2)
    {
        int m = s1.Length;
        int n = s2.Length;

        // Initialize result variable to store the final multiplication result
        int finalResult = 0;

        // Multiply each digit and accumulate results
        for (int i = m - 1; i >= 0; i--)
        {
            for (int j = n - 1; j >= 0; j--)
            {
                int digit1 = s1[i] - '0';
                int digit2 = s2[j] - '0';

                // Calculate the position to add the product
                int position = (m - 1 - i) + (n - 1 - j);

                // Multiply and accumulate into finalResult
                finalResult += digit1 * digit2 * (int)Math.Pow(10, position);
            }
        }

        return finalResult;
    }
}

```
