i hashed one out and its 3 for loops, one to do each row, and then one to print the spaces, and one to print the astericks. the spaces and astericks are in line as opposed to nested.
so in pseudocode
for (rows)
for(spaces){
}
wow. that got cut off and i don't have an edit button.
anyways, this is quick and dirty.
it also makes a very ugly tree, however should point you in the right direction.
what i did in the past is we took an input from the user for the size of the then modified our output depending on if their input was odd or even.
java
public class tree {
public tree() {
}
public static void main(String[] args) {
int input = 10;
double spaces = input/2;
for(int i=0; i < input; i++) {
for(int s = 0; s < spaces; s++){
System.out.print(" ");
}
for(int k = 0; k < i; k++){
System.out.print("*");
}
System.out.print("\n");
spaces= spaces-.5;
}
}
}