Problem Statement:Finding the repeated elements in an array You are required to
ID: 3618476 • Letter: P
Question
Problem Statement:Finding the repeated elements in an array
You are required to write a program that takes 10 integer valuesin an array as input from user. After getting input, the programshould find the elements with repetition and number of times eachelement is repeated.
DetailedDescription:
1. Declare an integer type array.
2. Take input from user in the array i.e. 10 integer values.
3. Pass this array to a function which will calculate and displaythe number of times an element is repeated.
4. If the array contains elements with repetition, the programshould only display the repeated elements and their count.
5. If there is no repetition in the array, the program shouldsimply display the message “There is no repetition in thearray”.
Sample Output1
Enter the value of array element 1 : 8
Enter the value of array element 2 : 6
Enter the value of array element 3 : 2
Enter the value of array element 4 : 4
Enter the value of array element 5 : 2
Enter the value of array element 6 : 2
Enter the value of array element 7 : 7
Enter the value of array element 8 : 8
Enter the value of array element 9 : 5
Enter the value of array element 10 : 6
2 is repeated 3 times
6 is repeated 2 times
8 is repeated 2 times
Sample Output2
Enter the value of array element 1 : 1
Enter the value of array element 2 : 3
Enter the value of array element 3 : 8
Enter the value of array element 4 : 7
Enter the value of array element 5 : 4
Enter the value of array element 6 : 9
Enter the value of array element 7 : 6
Enter the value of array element 8 : 5
Enter the value of array element 9 : 0
Enter the value of array element 10 : 2
Explanation / Answer
please rate - thanks you didn't specify the range of the numbers that can be input, Imade it any number--would have been much simpler for the numbers 0to 9 only #include using namespace std; void finddups(int[],int); int main() {int a[10],i; for(i=0;iRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.