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
Explain what happens if you free a pointer twice?
What’s a signal? Explain what do I use signals for?
Explain what is the purpose of "extern" keyword in a function declaration?
What are keywords in c with examples?
What are different types of variables in c?
List some applications of c programming language?
What is p in text message?
Should I learn c before c++?
How can I generate floating-point random numbers?
Why is #define used?
What is the use of #define preprocessor in c?
in linking some of os executables are linking name some of them
What are qualifiers in c?
Is swift based on c?
How can I write a function analogous to scanf?