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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Nov 24, 2011, 6:40 PM EST
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
Karthik AgarwalRank #2,270 · 620 reputationPosted Nov 24, 2011, 8:24 PM EST
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.
VulpesRank #55 · 29.2K reputationPosted Nov 24, 2011, 11:29 PM EST
Karthik AgarwalRank #2,270 · 620 reputationPosted Nov 24, 2011, 11:32 PM EST