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 / reshma

class My
{

public static void main(String[] args) {

int a1[] = {7,6,3,1,4};
int a2[] = {4,3,7,6};

int sum1= 0;
int sum2 = 0;
for(int i=0 ;i<a1.length;i++)
{
sum1 = sum1 + a1[i];
}

for(int j=0;j<a2.length;j++)
{
sum2 = sum2 + a2[j];

}
System.out.println("MISSED NO IS: "+(sum1 - sum2));
}
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what happens if you free a pointer twice?

1064


What’s a signal? Explain what do I use signals for?

1096


Explain what is the purpose of "extern" keyword in a function declaration?

1057


What are keywords in c with examples?

1073


What are different types of variables in c?

1053


List some applications of c programming language?

946


What is p in text message?

968


Should I learn c before c++?

1213


How can I generate floating-point random numbers?

1117


Why is #define used?

1267


What is the use of #define preprocessor in c?

1057


in linking some of os executables are linking name some of them

2111


What are qualifiers in c?

1020


Is swift based on c?

1087


How can I write a function analogous to scanf?

1161