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

What are nested functions in c?

761


What are runtime error?

834


Do you have any idea how to compare array with pointer in c?

812


What is difference between array and structure in c?

777


Can a local variable be volatile in c?

755


Explain what is the concatenation operator?

821


What is volatile variable in c?

850


What is the data segment that is followed by c?

817


Explain what is the most efficient way to store flag values?

914


What are extern variables in c?

728


Explain bitwise shift operators?

898


Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

995


Explain how do you determine the length of a string value that was stored in a variable?

893


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

782


What are keywords c?

785