J
jinto12
Hi,
i need to draw a empty triangle using only characters such as (*), the
thing is i need help figuring out the right side of the triangle.
public class Subclass {
public static void main (String args[]){
int counter=1;
int base=15;
while(counter<=(base/2)){
System.out.print(" ");
System.out.print("\n ");
for(int i= counter; i<=((base/2)-1);i++){//prints n-1 spaces
System.out.print(" ");
}
System.out.print("*");
for(int m=1; m<=((counter*2)-3); m++){//problem with this loop,
need help
System.out.print(" ");
}
System.out.print("*");
counter++;
}
System.out.print("\n");
for(int a=1; a<=base ;a++){System.out.print("*");}//base of the
triangle
}
}
i need to draw a empty triangle using only characters such as (*), the
thing is i need help figuring out the right side of the triangle.
public class Subclass {
public static void main (String args[]){
int counter=1;
int base=15;
while(counter<=(base/2)){
System.out.print(" ");
System.out.print("\n ");
for(int i= counter; i<=((base/2)-1);i++){//prints n-1 spaces
System.out.print(" ");
}
System.out.print("*");
for(int m=1; m<=((counter*2)-3); m++){//problem with this loop,
need help
System.out.print(" ");
}
System.out.print("*");
counter++;
}
System.out.print("\n");
for(int a=1; a<=base ;a++){System.out.print("*");}//base of the
triangle
}
}