hi I have problem in my code I'm trying to find the minimum height of a plant and the max height of the plant with a for loop but I'm running into a problem and I cant solve it (this in C# BTW) the code:
int i;
double height, min, max;
Console.WriteLine("Insert the height of plant");
height = double.Parse(Console.ReadLine());
min = 0;
max = 0;
for (i = 1; i <= 9; i++)
{
height = double.Parse(Console.ReadLine());
if(height >= max)
{
height = max;
}
if(height < max)
{
height = min;
}
}
Console.WriteLine("Maximum hight = {0}", max);
Console.WriteLine("Minimum hight = {0}", min);