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
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What is array within structure?
Can a void pointer point to a function?
What are different types of operators?
What are the 5 data types?
What is local and global variable in c?
Write a progarm to find the length of string using switch case?
What is a built-in function in C?
How can I read in an object file and jump to locations in it?
Explain the difference between exit() and _exit() function?
swap 2 numbers without using third variable?
Why is python slower than c?
Write a program to show the change in position of a cursor using c
What are the difference between a free-standing and a hosted environment?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?