Question: Write a c program that finds the uncommon elements from two array elements using pointers onl y . For example : Enter the length of

Write a c program that finds the uncommon elements from two array elements using pointers only .

For example : Enter the length of the array one : 5

Enter the elements of the array one: 9 8 5 6 3

Enter the length of the array two: 4

Enter the elements of the array two: 6 9 2 1

output: 8 5 3 2 1

void uncommon_ele(int *a, int n1, int *b, int n2, int *c, int*size);

The function should use pointer arithmetic not subscriptingto visit array elements. In

other words, eliminate the loop index variables and all use of the [] operator in the function.

The uncommon_ele function finds the elements that in either array a or array b, but not both, and stores the result in array c. The function takes an int array parameters a1 and 2 as the first parameter and third parameters and the number of elements of the arrays as the second parameter.

The sixth parameter size points to a variable in whi ch the function will store thenumber of

actual elements in array c.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!