private int FindSecondHighestInt()
{
int[] testArray = { 6,4, 7, 9, 10, 3, 2 };
int highest, secondHighest, temp;
highest = testArray[0];
secondHighest = testArray[0];
for (int i = 0; i < testArray.Length; i++)
{
temp = testArray[i];
if ( temp > highest)
{
secondHighest = highest;
highest = temp;
}
else
if (temp > secondHighest)
{
secondHighest = temp;
}
}
return secondHighest;
}
_____________________________________________
Wednesday, December 17, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment