Skip to content

Instantly share code, notes, and snippets.

@pepet96
Created November 13, 2013 23:30
Show Gist options
  • Save pepet96/7458442 to your computer and use it in GitHub Desktop.
Save pepet96/7458442 to your computer and use it in GitHub Desktop.
AsteriskTriangle
import java.util.Scanner;
class AsteriskTriangle {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int initial, next, last;
System.out.println("Please type an integer: ");
initial = input.nextInt();
next = 1;
for (next = 1; next < initial; next++){
for (last = 1; last < next; last++){
System.out.print("*");
}
System.out.println("*");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment