int[] isNum = { 1, 4, 6, 10, 9, 12, 3, 5 };
int iMaxvalue=0;
for (int i = 0; i < isNum.Length; i++)
{
if(iMaxvalue<Convert.ToInt32(isNum[i].ToString()))
{
iMaxvalue = Convert.ToInt32(isNum[i].ToString());
}
}
int iMaxvalue=0;
for (int i = 0; i < isNum.Length; i++)
{
if(iMaxvalue<Convert.ToInt32(isNum[i].ToString()))
{
iMaxvalue = Convert.ToInt32(isNum[i].ToString());
}
}
(or)
int itestValue = isNum.Max();
No comments:
Post a Comment
Comments