Write a program to find the frequency of presence an element in array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write a program to find the frequency of presence an element in array

23rd Jul 2019, 3:10 PM
Devaraj N
Devaraj N - avatar
3 Answers
0
Create a count var then loop through your arr.
24th Jul 2019, 12:24 AM
LetterC67
LetterC67 - avatar
0
I don't understand can you explain more please?
25th Jul 2019, 3:39 PM
Cout
Cout - avatar
- 1
count = 0 // n is size of your arr for (int i=0;i<n;i++){ if(a[i] == 4) count++; } Hope it can help!
27th Jul 2019, 1:41 AM
LetterC67
LetterC67 - avatar