Make repeating numbers 0 and putting them at the beginning of array
Declaration


  int arr[],n,i,j,nr[]= new int[5];



Consider to declare variables on separate lines. From Code Complete, 2nd Edition, p761:


  Use only one data declaration per line
  
  [...]
  
  It’s easier to modify declarations because each declaration is self-contained.
  
  [...]
  
  It’s easier to find specific variables because you can scan a single column rather than reading each line. It’s easier to find and fix syntax errors because the line number the compiler gives you has only one declaration >on it.


Unused Variables


  int count =0;



count gets declared and initialized but is never in use.. Unused variables should be removed. 

Magic Number


  Your code uses a number that has a certain meaning to it.


One magic number is hidden in the code.


  if(n&gt;25) {



You can create a new constant variable MAX_SIZE


  if(n&gt;MAX_SIZE) {
``



Formatting


  for( i=0; i&lt; arr.length-1;i++)
{ for (j=i+1;j&lt;arr.length;j++)
    {if(arr[i]==arr[j])
       nr[i]=arr[i];
        System.out.println(nr[i]);
    }}



The code has an inconsistent formatting. Some key words are on a new-line and some times on the same line of a {.

Additional the code is format in a more C-like style, which I respect but you should have a look into Oracles Code Conventions for the Java.

Reduce Code Complexity Via Methods

When we consider a Code Smell Metrics and look at the code, we will find at least two points, that apply:


  
  Methods with more than 20 lines of code 
  Methods with nesting more than 2 (?) levels deep 
  Any global or static variables
  


To reduce the complexity we can introduce some new methods. For example


  for(i=0;i&lt;n;i++)
{
    arr[i] = sc.nextInt();
}



can be wrapped into a method storeUserInput.