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
Explain the difference between the local variable and global variable in c?
Explain pointer. What are function pointers in C?
pierrot's divisor program using c or c++ code
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
What is || operator and how does it function in a program?
Explain the use of 'auto' keyword in c programming?
What are register variables in c?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
Should a function contain a return statement if it does not return a value?
What is function in c with example?
please give me some tips for the placement in the TCS.
Is there a way to jump out of a function or functions?
What are the primitive data types in c?
How #define works?
What is an lvalue?