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...

Give two integer arrays A & B.A has n elements and B has ' n-1 ' elements . A has all the elements that are there in B. But B has one missing element. Write a function that takes arrays , A & B as imnput and finds the missing element in most optised manner .

Answer Posted / abhi

#include<iostream>
using namespace std;
#include<algorithm>
int main()
{
int n;
cin>>n;
int a[n],b[n-1];
int sum1=0,sum2=0;
for(int i=0;i<n;i++)
{
cin>>a[i];
sum1+=a[i];
}
for(int i=0;i<n-1;i++)
{
cin>>b[i];
sum2+=b[i];
}
cout<<sum1-sum2<<endl;



}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program that will accept a number and print.its equivalent in words the maximum input number is 9999

3083


In what scenario does the Logical file and Physical file being used?

2948


Why should a c++ programmer be interested in stl?

1149


What does stl stand for in basketball?

1223


How do you convert stl to steps?

1204


What do stl stand for?

1200


What is the stl, standard template library?

1142


Describe the My Computer and My Documents folders; identify the elements that are present in every Window.

2590


How is stl different from c++ standard library?

1392


What is meant by stl in c++?

1209


draw a flowchart that accepts two numbers and checks if the first is divisible by the second.

3430


How stl is different from the c++ standard library?

1280


What does stl mean in slang?

1166


how can u do connectivity in c++ language? plz send me connectivity code in c++ ?

2396


What are the symptoms of stl?

1153