import java.util.Scanner;
Some body help please !!!
goes without saying i see the correct out put on my ecllipse
public class Main
{
public static void main (String args[])
{
int noofTree=0;
boolean flag=false;
int counter=0;
Scanner scan= new Scanner(System.in);
// System.out.print("Enter the No of Trees\n");
try{
noofTree= scan.nextInt();
}
catch(NumberFormatException nfe)
{
nfe.printStackTrace();
}
int []anArray;
// System.out.print("Enter the Co-ordinates\n");
anArray= new int[10];
for (int i=0;i {
try{
anArray[i]=scan.nextInt();
}
catch(NumberFormatException nfe)
{
nfe.printStackTrace();
}
System.out.print(anArray[i]);
}
int i=0;
int k=1;
int diff=0;
int max=0;
max=anArray[--noofTree];
diff=anArray[k]-anArray[i];
System.out.print("Diff="+diff);
k=1;
loop: for(int no=diff;no>0;no--)
{
int var=anArray[i];
while(var<=max)
{
var+=no;
if(var>max)
{
counter=0;
k=1;
continue loop;
}
if(var!=(anArray[k]))
{
counter++;
}
if (var==anArray[k])
{
if(var==max)
{
flag=true;
System.out.print(counter);
System.exit(1);
}
if(var<=anArray[k])
{
k++;
}
}
}
}
}
}