0
i have a problem with a code c++
im searching about the number is repeated in array exempl : 5 3 4 2 5 3 6 5 8 5 the number 3 is repeated 2 the number 5 is repeated 4
2 Answers
+ 1
You can resolve your issue by using simple FOR LOOP. You'll loop through the array, and in the loop have a condition that checks for the number. If it's true, increase the counter by 1. The counter will keep track of the number of times it appears. Then afterward just use the counter variable as a means of displaying how many times it repeated.