Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

/** * Function: num_distinct * Parameters: * integer array a[]: array of data *

ID: 640837 • Letter: #

Question

/**

* Function: num_distinct

* Parameters:

* integer array a[]: array of data

* integer n: length of array a

* Description: returns the number of distinct integers in array a[]

* if a = {1, 2, 3}, all three entries are distinct so 3 is returned.

* if a = {1, 1, 1, 1, 1}, then there is only one distinct value (1)

* so 1 is returned.

* RULES: You may NOT re-order the elements of the array (or modify

* its contents in any way).

int num_distinct(int a[], int n);

PLEASE program this function in C and use stdio.h library

Explanation / Answer

yes