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
Why does everyone say not to use gets?
Is swift based on c?
Is void a keyword in c?
What is data structure in c and its types?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
What is difference between constant pointer and constant variable?
What is a nested loop?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
What do you mean by c what are the main characteristics of c language?
Explain how can I remove the trailing spaces from a string?
What is #define in c?
What are the uses of a pointer?
Explain what math functions are available for integers? For floating point?
Implement bit Array in C.
How can I delete a file?