/*Java
create triangle pattern*/(not per record)
import java.util.*;
public
class Symbols {
public static void main(String[] args) {
Scanner read = new Scanner (System.in);
int nline, count, countl, nspace= 0, i;
char symbol;
System.out.print(" how many lines you
want to print? ");
nline= read.nextInt();
System.out.print("what is the symbol you
want to use: ");
symbol= read.next().charAt(0);
for (countl=1; countl<=nline; countl++){
System.out.println();
for(count=1;
count<=countl; count++)
System.out.print(symbol);
}
}
}
No comments:
Post a Comment