if array a conatins 'n' elements and array b conatins 'n-1'
elements.array b has all element which are present in array
a but one element is missing in array b. find that
element.
Answer Posted / ajay c.
Take a temp variable of datatype of the array element.
Place a[0] in temp.
now for each element in array a compare with all elements
of array b. if any element is not found in array b, that is
the missing element.
what i guess though is that the interviewer may be trying
to look for a short-cut method to achieve the above. So, i
googled it and found a very nice answer:
http://stackoverflow.com/questions/1235033/java-comparing-
two-string-arrays-and-removing-elements-that-exist-in-both-
arrays
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Why do we need arrays in c?
What is break in c?
Explain why c is faster than c++?
Explain #pragma statements.
Is c call by value?
What is a static function in c?
What is the role of && operator in a program code?
How important is structure in life?
How would you rename a function in C?
How will you find a duplicate number in a array without negating the nos ?
Why do we use stdio h and conio h?
What is the use of bitwise operator?
Differentiate between functions getch() and getche().
How can I do peek and poke in c?
explain how do you use macro?