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

Explain how do you convert strings to numbers in c?

791


What is the value of uninitialized variable in c?

775


What are the different types of control structures?

779


What is #define used for in c?

788


If the size of int data type is two bytes, what is the range of signed int data type?

769






Difference between pass by reference and pass by value?

840


What are high level languages like C and FORTRAN also known as?

890


What functions are used in dynamic memory allocation in c?

767


Can we declare a function inside a function in c?

787


What is define c?

756


What is ctrl c called?

771


What is void main ()?

791


How does selection sort work in c?

795


What do you mean by a sequential access file?

792


write a programming in c to find the sum of all elements in an array through function.

1897