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
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
What is meant by realloc()?
What is difference between %d and %i in c?
Write a program to find the biggest number of three numbers in c?
What does the error message "DGROUP exceeds 64K" mean?
What is I ++ in c programming?
how can use subset in c program and give more example
How can you increase the allowable number of simultaneously open files?
What is double pointer in c?
List a few unconditional control statement in c.
What is the difference between #include
What are multibyte characters?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
What is the value of c?
Explain what is the benefit of using #define to declare a constant?