csharp beginner

csharp beginner

  • NA
  • 38
  • 12.1k

comparing arrays

Nov 9 2013 3:02 AM
i have three arrays, say, array1, array2, array3. 

array1 = {10, 11, 12, 13, 14 , 15, 16, 17, 18, 19, 20}

array2 = {10, 11, 13, 16, 19, 20}
array3 = {22, 25, 75, 36, 82, 99}

i want to check: if 'ith' element from array1 is present in array2, then write 'ith' element of array3, corresponding to array2, else, put a null value.

Note:
# array2.length = array3.length

#The result should be like:
        10        22
        11        25
        12        null
        13        75
        14        null
        15        null
        16        36
        17        null
        18        null
        19        82
        20        99

can anybody help?

Regards


Answers (2)