File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -126,3 +126,55 @@ public static void main(String[] args) {
126
126
127
127
}
128
128
}
129
+
130
+ class Pattern10 {
131
+ public static void inverted_rotated_half_pyramid (int n ){
132
+ //outer
133
+ for (int i =1 ;i <=n ;i ++){
134
+ //spaces
135
+ for (int j =1 ;j <=n -i ;j ++){
136
+ System .out .print (" " );
137
+ }
138
+ //stars
139
+ for (int j =1 ;j <=i ;j ++){
140
+ System .out .print ("*" );
141
+ }
142
+ System .out .println ();
143
+ }
144
+
145
+ }
146
+ public static void main (String [] args ) {
147
+ inverted_rotated_half_pyramid (4 );
148
+ }
149
+ }
150
+
151
+ class Pattern11 {
152
+
153
+ public static void invertedHalfPyramidWithNumbers (int n ){
154
+ for (int i =1 ;i <=n ;i ++){
155
+ for (int j =1 ;j <=n -i +1 ;j ++){
156
+ System .out .print (j );
157
+ }
158
+ System .out .println ();
159
+ }
160
+ }
161
+ public static void main (String [] args ) {
162
+ invertedHalfPyramidWithNumbers (5 );
163
+ }
164
+ }
165
+
166
+ class Pattern12 {
167
+ public static void fLoydsTriangle (int n ){
168
+ int c =1 ;
169
+ for (int i =1 ;i <=n ;i ++){
170
+ for (int j =1 ;j <=i ;j ++){
171
+ System .out .print (c + " " );
172
+ c ++;
173
+ }
174
+ System .out .println ();
175
+ }
176
+ }
177
+ public static void main (String [] args ) {
178
+ fLoydsTriangle (5 );
179
+ }
180
+ }
You can’t perform that action at this time.
0 commit comments