How tall is your name
import java.lang.*;
public class PatternPrint {
public static void main(String[] args) {
String input = "NOAH CAT";
input = input.replace(" ", "");
int length = input.length();
for (int i = 0; i < length; i ) {
for (int j = 0; j <= i; j ) {
System.out.print(input.charAt(j));
}
System.out.println();
}
}
}
How tall is your name
P
PU
PUN
PUNI
PUNIT
PUNIT S
PUNIT SI
PUNIT SIN
PUNIT SING
PUNIT SINGH