Hi, i was wondering if anyone could give me some advice on how to print something like this
#
##
###
####
#####
######
#######
I need to use a while statement. Any help is appreciated thanks
Printable View
Hi, i was wondering if anyone could give me some advice on how to print something like this
#
##
###
####
#####
######
#######
I need to use a while statement. Any help is appreciated thanks
This should do it.
Simple enough. Hope that helps :)Code:public static void main ( String args[] ) {
int i = 0;
String S = "";
while ( i < 7 ) {
S += "#";
System.out.println ( S );
i ++;
}
}