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 / sumanth
firt do sum of n elements in first array a i.e., n(n+1)/2
next the sum of n-1 elements in second array b i.e., n(n-1)/2...
from diff of these 2 sums we will get the missing element in b
| Is This Answer Correct ? | 30 Yes | 11 No |
Post New Answer View All Answers
Explain the use of #pragma exit?
Is array name a pointer?
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What is a stream in c programming?
What language is lisp written in?
What is the difference between %d and %i?
Explain bit masking in c?
Why do we use main function?
Write a program to reverse a given number in c?
Are there any problems with performing mathematical operations on different variable types?
Write a program to reverse a string.
List the difference between a "copy constructor" and a "assignment operator"?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
How can you tell whether two strings are the same?
What is advantage of pointer in c?