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
What are nested functions in c?
What are runtime error?
Do you have any idea how to compare array with pointer in c?
What is difference between array and structure in c?
Can a local variable be volatile in c?
Explain what is the concatenation operator?
What is volatile variable in c?
What is the data segment that is followed by c?
Explain what is the most efficient way to store flag values?
What are extern variables in c?
Explain bitwise shift operators?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
Explain how do you determine the length of a string value that was stored in a variable?
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What are keywords c?