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

How pointer is different from array?

585


Explain how do you list a file’s date and time?

621


Explain pointer. What are function pointers in C?

630


Why void is used in c?

569


What is the function of this pointer?

679






Should a function contain a return statement if it does not return a value?

601


Explain union. What are its advantages?

621


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

1743


code for replace tabs with equivalent number of blanks

1645


Explain the use of function toupper() with and example code?

657


What is the argument of a function in c?

579


How can I get the current date or time of day in a c program?

654


What are local static variables?

622


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

2195


Explain why can’t constant values be used to define an array’s initial size?

860