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

26th Mar 2018, 3:49 PM
Habib Ellah
Habib Ellah - avatar
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.
26th Mar 2018, 4:44 PM
Fata1 Err0r
Fata1 Err0r - avatar