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.
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.
Vimal KandasamyPosted Mar 6, 2009, 3:26 AM
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