public void MinimumValInt()
{
int[] intArray = new int[7] { 10,4,5,1,7,15,12};
int minVal = intArray[0];
for (int i = 1; i < intArray.Length; i++)
{
if (intArray[i] < minVal)
{
minVal = intArray[i];
}
}
Console.WriteLine("Minimum value= "+minVal);
}
Output: Minimum value=1
wow. this is something new. thanks
ReplyDelete