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
How pointer is different from array?
Explain how do you list a file’s date and time?
Explain pointer. What are function pointers in C?
Why void is used in c?
What is the function of this pointer?
Should a function contain a return statement if it does not return a value?
Explain union. What are its advantages?
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.
code for replace tabs with equivalent number of blanks
Explain the use of function toupper() with and example code?
What is the argument of a function in c?
How can I get the current date or time of day in a c program?
What are local static variables?
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
Explain why can’t constant values be used to define an array’s initial size?