Hi friends,
Would you like to tell me that how to find the second highest number in arraylist? And also tell how to concatenate two integer values without using any conversion technique.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Karthik AgarwalPosted Nov 25, 2011, 4:32 AM
VulpesPosted Nov 25, 2011, 4:29 AM
Karthik AgarwalPosted Nov 25, 2011, 1:24 AM
myAL.Add(1);//adding values to array list
myAL.Add(2);
myAL.Add(3);
myAL.Add(9);
myAL.Add(-1);
myAL.Add(-3);
myAL.Sort();//sorting values in the array list
Console.WriteLine(myAL[myAL.Count - 1]);//printing highest value on the console window where myAl.Count is the number of elements present in the array list.
Satyapriya NayakPosted Nov 24, 2011, 11:40 PM
Second highest number in arraylist
ArrayList list = new ArrayList();
list.Add(1);
list.Add(2);
list.Add(3);
list.Add(4);
list.Add(5);
list.Sort();
MessageBox.Show(list[3].ToString());
Thanks