One of the most common exercises using Loops in Java is creating different patterns. By creating different asterisk patterns, a newbie to the corners of computer programming can easily grasp the concept of Loops.
1 2 3 4 5 6 7 8 9 10 11 12
public class PatternOne{
public static void main(String[]args){
for(int x=0; x<5; x++){
System.out.println(" ");
for(int z=0; z<=x; z++){
System.out.print("*");
}
}
}
}


Mag-post ng isang Komento