write a function that accepts an array A with n elements and
array B with n-1 elements. Find the missing one in array
B,with an optimized manner?

Answer Posted / aravind

#include<stdio.h>
int missing_item(int,int);
int main()
{
int a[10];
int b[9];
printf("enter size of array");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("enter the elemets of array a ");
scanf("%d",&a);
}

for(i=0;i<n-1;i++)
{
printf("enter b elements");
scanf("%d",&b);
missing_item(int c,int d)
{
int item;
for(i=0;i<n;i++)
{
if(c[i]==d[i])
break;
else
{
item=c[i];
printf("the missing item is=%d",c[i]);
}

}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between the local variable and global variable in c?

589


Explain pointer. What are function pointers in C?

618


pierrot's divisor program using c or c++ code

1719


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

646


What is || operator and how does it function in a program?

620






Explain the use of 'auto' keyword in c programming?

669


What are register variables in c?

564


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4167


Should a function contain a return statement if it does not return a value?

588


What is function in c with example?

619


please give me some tips for the placement in the TCS.

1623


Is there a way to jump out of a function or functions?

627


What are the primitive data types in c?

563


How #define works?

606


What is an lvalue?

627