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


Please Help Members By Posting Answers For Below Questions

Why do we need arrays in c?

581


What is break in c?

587


Explain why c is faster than c++?

572


Explain #pragma statements.

604


Is c call by value?

603






What is a static function in c?

621


What is the role of && operator in a program code?

566


How important is structure in life?

590


How would you rename a function in C?

617


How will you find a duplicate number in a array without negating the nos ?

1642


Why do we use stdio h and conio h?

633


What is the use of bitwise operator?

686


Differentiate between functions getch() and getche().

620


How can I do peek and poke in c?

617


explain how do you use macro?

666