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 is nested structure in c?

620


Tell me what is null pointer in c?

617


Explain how do you generate random numbers in c?

628


Why isnt any of this standardized in c?

643


Tell us the use of fflush() function in c language?

645






Describe the order of precedence with regards to operators in C.

638


Give basis knowledge of web designing ...

1582


Explain About fork()?

654


What is pointer to pointer in c with example?

556


Why array is used in c?

557


What do you mean by a sequential access file?

633


What is pragma in c?

636


Why main function is special give two reasons?

957


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

621


What is sizeof in c?

577