Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what are # pragma staments?

2010


What does the error message "DGROUP exceeds 64K" mean?

1191


How can I sort more data than will fit in memory?

1061


What is wrong with this code?

1147


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1836


pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

2301


Why pointers are used in c?

972


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

3049


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

2491


Combinations of fibanocci prime series

1567


What is c preprocessor mean?

1271


Can we change the value of #define in c?

979


the question is that what you have been doing all these periods (one year gap)

2045


Is stack a keyword in c?

1057


Do you know what are bitwise shift operators in c programming?

1080