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
Explain how do you convert strings to numbers in c?
What is the value of uninitialized variable in c?
What are the different types of control structures?
What is #define used for in c?
If the size of int data type is two bytes, what is the range of signed int data type?
Difference between pass by reference and pass by value?
What are high level languages like C and FORTRAN also known as?
What functions are used in dynamic memory allocation in c?
Can we declare a function inside a function in c?
What is define c?
What is ctrl c called?
What is void main ()?
How does selection sort work in c?
What do you mean by a sequential access file?
write a programming in c to find the sum of all elements in an array through function.