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 / vadivel t
#include<stdio.h>
#include<math.h>
void main()
{
int a1[5] = {2,5,3,1,4}, a2[4] = {1,2,4,5};
int i, n = 5, sum1= 0, sum2 = 0;
for(i = 0; i <= n-1; i++)
{
sum1 = sum1 + a1[i];
if(i <= n-2)
{
sum2 = sum2 + a2[i];
}
}
printf("MISSED NO IS: %d",(sum1 - sum2));
_getch();
}
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
What is character constants?
Explain high-order and low-order bytes.
Explain how do you determine the length of a string value that was stored in a variable?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
What is ## preprocessor operator in c?
When is the “void” keyword used in a function?
Explain two-dimensional array.
What are the __date__ and __time__ preprocessor commands?
What is double pointer?
What is difference between structure and union in c?
What are shell structures used for?
How many types of operator or there in c?
praagnovation
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
How many bytes are occupied by near, far and huge pointers (dos)?