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


Please Help Members By Posting Answers For Below Questions

int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer

648


What is the difference between union and anonymous union?

833


Is it possible to execute code even after the program exits the main() function?

807


Explain what are its uses in c programming?

590


What is echo in c programming?

555






An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

654


Explain the difference between structs and unions in c?

572


When should the register modifier be used? Does it really help?

607


How does #define work?

642


Can we declare variable anywhere in c?

533


What is the use of clrscr?

591


What does void main () mean?

729


Explain what’s a signal? Explain what do I use signals for?

606


Why #include is used in c language?

594


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

664