why my code is wrong
I want to write a code that can draw triangle
public class A{
public static void main(String [] args){
for(int i=0; i<2; i++)
{
for(int a=2; a<2-i; a++)
System.out.print(" ");
for(int b=0; b<2i+1; b++)
System.out.print("*");
System.out.println();
}
}
}
but it shows me: why?
H:\A.java:8: ';' expected
for(int b=0; b<2i+1; b++)
^
1 error
Tool completed with exit code 1