Source Code: package BasicJava ; import java.util.Scanner ; public class PatternMyselfPractise { public static void main ( String [] args ) { /*SampleOutput: * * ** ** *** *** **** **** ********** */ Scanner input = new Scanner ( System . in ); int a , b , c ; System . out . println ( "How many lines:" ); a = input . nextInt (); b = a ; for ( int i = 1 ; i <= a ; i ++) { for ( int j = 1 ; j <= i ; j ++) { System . out . print ( "*" ); } for ( int k = 1 ; k <= 2 *( b - 1 ); k ++) { System . out . print ( " " ); ...
Comments
Post a Comment