when you do
do
{
x=a/2;
y=a%2;
if(y==0)
{
a=x;
}
}while(y==0 && x!=1);
always x=1, y=0, a=1
and then in the if-else
if(y==0 && x==1)
{
ary[v]=s; //in this line i get error
++v;
}
ALWAYS y==0 and x==1 and ++v is executed as a infinity loop
v=1,2,3,……200 and crash
15
solved Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 200