Hello,
Why break function doesn't work at that code ?:
double Number = 0, counter = 0; // declare here.
for (int i = 1; i <= 10; i++)
{
//Entering ten numbers
Console.Write("Enter the number:");
Number += double.Parse(Console.ReadLine()); //keep incrementing number
/*If user write number 0 in console before he conclude the 10th number,
program will calculate just average of entered numbers*/
if (Number == 0)
break;
counter++; // Monitor the number of loops in case they break out early.
}
double avg = Number / counter;
Console.WriteLine("An average of entered numbers is {0}", avg);
Console.ReadLine();
Any help is welcome.
bisiii