avaEjercicio of the book "How to program in java" Type 5.10 an application that displays the following patterns separately, one below another. Use for loops to generate the patterns. All asterisks (*) must be printed by a single statement of how System.out.printl ("*"); which causes the asterisks to be printed next to each other.
Cinco10 {public static void main (String [] args) {String output = ""; otravez: for (int f = 1; f output + = "\\ n";
if (c> f) continue otravez; +="*"; output}} System.out.println (output);
/ / Second
for (int f = 1;
{if (c
for (int y = 0; and
} System.out.println (); x + +;
} / / fourth drawing
for (int y = x, y> = 0, y -) {
System.out.println ();
x -;}
Result:
0 comments:
Post a Comment