hi,
i have an array a =[1,3,5,7] and array b =[2,4,6,8]..what all i need is array c =[1,2,3,4,5,6,7,8]
Please let me know the code for this.
Thanks in advance.
hi,
i have an array a =[1,3,5,7] and array b =[2,4,6,8]..what all i need is array c =[1,2,3,4,5,6,7,8]
Please let me know the code for this.
Thanks in advance.
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 attend4days leftRegister
Vimal KandasamyRank #2,151 · 661 reputationPosted Mar 5, 2009, 10:26 PM EST
try this....
int[] a ={ 1, 3, 5, 7 };
int[] b ={ 2, 4, 6, 8 };
int[] c=new int[a.Length+b.Length];
a.CopyTo(c, 0);
b.CopyTo(c, a.Length);
Array.Sort(c);
now c={1,2,3,4,5,6,7,8}
try it