title: Duplicate Elimination
body: <p>i have problem with this question </p>
  
  <p>Duplicate Elimination
  Use a one-dimensional array to solve the following problem: Write an application that inputs 10 integers. As each number is read, display it only if it is not a duplicate of a number already read. Use the smallest possible array to solve this problem. Display the complete set of unique values input after the user inputs all values.</p>
  
  <p>Sample Output:</p>
  
  <p>Enter 10 integers:</p>
  
  <p>12  33  67  9  10  6  6  34  10  19 </p>
  
  <p>Unique Values:</p>
  
  <p>12  33  67  9  10  6  34  19 
  <strong><em>note the question ask to reprint the array but without any repeating number</em></strong></p>
  
  <p>and this is my code </p>
  
  <pre><code>import java.util.Scanner;
  
  public class duplicate 
  {
  
  public static void main(String[] args)
  {
      Scanner input = new Scanner(System.in);
      int[] array = new int[10];
      int[] barray = new int[10];
  
      System.out.println(" Enter 10 integers: ");
      int i ;
      for(i=0;i&lt;array.length;i++)
      {
          array[i]= input.nextInt();
          barray[i] = array[i];
      }
      for(i=0;i&lt;array.length;i++)
      {
          System.out.printf("\t %d ",array[i]);
  
      }
      System.out.println("\n Unique values are: ");
  
  
          for ( i = 0; i &lt; array.length; i++ )
          {
  
  
              {
                  if ( array[ i ] == barray[ i ] )
                      break;
                    System.out.printf("\t %d",array[i]);
  
              }
  
  
          }
  
      }
  </code></pre>
  
  <p>}</p>