Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Find out duplicate number between 1 to n numbers in java

public class Main{ public static void main(String[] args){ int [] arr = new int [] {10,34,56,67,10,56,3}; System.out.println("Duplicate elements are "); for(int i = 0; i < arr.length; i++) { for(int j = i + 1; j < arr.length; j++) { if(arr[i] == arr[j]) System.out.println(arr[j]); } } } } 
Source by inlarn.com #
 
PREVIOUS NEXT
Tagged: #Find #duplicate #number #numbers #java
ADD COMMENT
Topic
Name
9+2 =