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
What is the meaning of typedef struct in c?
How can I find the modification date of a file?
Write programs for String Reversal & Palindrome check
explain what is fifo?
What is difference between constant pointer and constant variable?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
What is difference between arrays and pointers?
What functions are used for dynamic memory allocation in c language?
Write a program with dynamically allocation of variable.
string reverse using recursion
Can you apply link and association interchangeably?
Explain what is a static function?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
What does double pointer mean in c?