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
How can I invoke another program or command and trap its output?
What is the difference between fread buffer() and fwrite buffer()?
Explain the use of keyword 'register' with respect to variables.
How can I read/write structures from/to data files?
what do you mean by enumeration constant?
What is c system32 taskhostw exe?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
What the advantages of using Unions?
Explain setjmp()?
How can I automatically locate a programs configuration files in the same directory as the executable?
What are conditional operators in C?
Is it possible to initialize a variable at the time it was declared?
Why array is used in c?
Why doesnt long int work?
Explain can the sizeof operator be used to tell the size of an array passed to a function?