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
can anyone please tell about the nested interrupts?
Give basis knowledge of web designing ...
How can I determine whether a machines byte order is big-endian or little-endian?
What is data types?
How will you delete a node in DLL?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
How can I rethow can I return a sequence of random numbers which dont repeat at all?
How do you use a pointer to a function?
Are there namespaces in c?
How do we make a global variable accessible across files? Explain the extern keyword?
Can we change the value of static variable in c?
What is the purpose of the statement: strcat (S2, S1)?
Write a program which returns the first non repetitive character in the string?
The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.
Write a program to print “hello world” without using semicolon?