Skip to main content

Posts

Showing posts from November, 2020

C program to print all repeated elements in an array and also print the count of repeated numbers

  Write a program to print all repeated elements in an array and also print the count of repeated numbers Note: Hope it helps you! Please note that all the intentions are to clear the doubt of how to solve it in java. So, please try to give it a chance at least before using this. If you face any discrepancy please contact us. Thank you! Example: input: Enter the number of element: 4 Enter Elements: 10 20 10 20 output: The duplicate number is: 10 The duplicate number is: 20 The total number of the duplicate element is: 2 Algorithm of this program: Initially, we define the size of the array. Then, take a user-input size of the array and scan the element of the array. For finding the duplicate number in the array we have to run two for loops. The first for loop scan all elements from 0 index The next for loops run from i+1 so that it checks all the duplicate elements. If any duplicate element is found, we print the duplicate number and count it. At last, we print the count of all