Implement a function that receives an array of integers "arr" and an integer "int",
which returns the number of occurrences of element int in array arr".
For instance, given art = 12,3,4,3,2,1) and int=3, the function should return 2
Answers
Answered by
0
Answer:
sorry but a lot of audience there is not of computer science all app to answer this question
Answered by
1
Answer:
int arr[] = [2,3,4,3,2,1];
int x = 3;
int y = 0;
function(arr[], x)
{
for(int I=0; arr[I] = = x; I++)
y = y+1;
return y;
}
Explanation:
I is used to iterate through index values
initiating y to 0 so that there are no garbage values added
Similar questions