else
{
r=Power(s,n-1);
System.out.println(r);
int d=r.length;
char ch=s.charAt(n);
int v=d+1;
p[v]=Character.toString(ch);
String q = p[v];
for(i=d+2,j=0;i<2d+3,j<d;i++,j++)
{
p[i]=r[j].concat(q);
}
}
A syntax error is shown and var j is not recognized even after declaration... pls help me.
The problem is the condition of the loop. The correct should be:
for(i=d+2,j=0;i<2d+3 && j<d;i++,j++){ ...
or
for(i=d+2,j=0;i<2d+3 || j<d;i++,j++){ ...
There is no meaning in putting a comma separating two boolean conditions in java.
And as seen in the comments, variables j
and i
are not declared.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With