Q:

C#. How to count digits entered from input?

This is a code which multiplies numbers, user enters.
string x;
double t, s = 1;

Console.WriteLine("Enter some numbers: ");
Console.WriteLine("To finish, press Enter");
while ((x = Console.ReadLine()) != "")
{
    t = Convert.ToDouble(x);
    s *= t;
}
Console.WriteLine("The result is: {0}", s);
Console.ReadLine();

It shows the result at the end, but how to make it show a total count of numbers entered?
For example: I enter 1, 2 and 3. So total count is 3.

A:

string x;
double t, s = 1;
int count = 0;

Console.WriteLine("Enter some numbers: ");
Console.WriteLine("To finish, press Enter");
while ((x = Console.ReadLine()) != "")
{
    t = Convert.ToDouble(x);
    s *= t;
    count++;
}
Console.WriteLine("The result is: {0}", s);
Console.WriteLine("The count is: {0}", count);
Console.ReadLine();

