jeudi 12 février 2015

Which logic to use in Java Star pattern program without 'for' loop?

Is this the correct way to get the star pattern?



public static void main(String[] args)
{
System.out.println(" *");
System.out.println(" ***");
System.out.println(" *****");
System.out.println("*******");
System.out.println(" *****");
System.out.println(" ***");
System.out.println(" *");
}
}

Aucun commentaire:

Enregistrer un commentaire