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 / venu
use XOR association operation.
I mean: a = b^a^b = a^b^b = a;[bec a^a =0 always]
int main()
{
int a[3] = {3,4,5};
int b[4] = {7,4,5,3};
int r,i;
int n=4;
r1 = b[3];
for(i=0;i<n-1;i++)
{
r1 = r1^a[i]^b[i];
}
printf("number = %d \n",r);
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Write a program to find factorial of a number using recursive function.
What is the mean of function?
What does a function declared as pascal do differently?
What are the features of c languages?
what is uses of .net
What is static memory allocation?
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
How do we open a binary file in Read/Write mode in C?
Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?
What are header files in c programming?
When should you use a type cast?
What is infinite loop?
What is class and object in c?
Linked lists -- can you tell me how to check whether a linked list is circular?
What are reserved words?