Hello, I’m working on this task:
Write a program that reads integer count and then reads count integer numbers from the console and outputs their minimum. Example:
>3
>14
>57
>-10
-10
Here is my code:
namespace ForLoops
{
class Minimum
{
static void Main(string[] args)
{
int count = int.Parse(Console.ReadLine());
int sum = 0;
for (int i = 1; i <= count; i++)
{
int cInteger = int.Parse(Console.ReadLine());
if(i == count && cInteger < sum)
{
Console.WriteLine(cInteger);
}
}
}
}
}
Can anyone please help me to solve it?
Can’t get my head around finding the min number.