Question:
Count Occurance DXC Automata Fix Questions AMCAT
int countOccurance(int len,int value,int *arr)
{
int i=0,count =0;
while(i<len){
if(arr[i] == value)
count += 1;
}
return count;
}
Solution:
int countOccurance(int len,int value,int *arr)
{
int i=0,count =0;
while(i<len){
if(arr[i] == value)
count += 1;
i+=1;
}
return count;
}