mardi 28 avril 2015

how to write nested loops that prints the capital letter F using *

  for (int i = 1; i <= 7; i++)
     if (i < 3 || i == 4) for (int j = 1; j <= 5; j++)
     System.out.print("*");
    if (1 > 2 && 1 < 4 || 1 > 4 && 1 <= 7) for (int k = 1; k <= 2; k++)
     System.out.print("*");
    System.out.print("");
    }
  }


**************
*****
*****
**************
**************
*****
*****
*****
*****

i want do like this using (for and if).

Aucun commentaire:

Enregistrer un commentaire