File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package Scaler .Assignments ;
2+
3+ public class FullNumericPyramid {
4+ public static void main (String [] args ) {
5+
6+ printFullNumericPyramid ();
7+
8+ }
9+
10+ static void printFullNumericPyramid (){
11+
12+ int totalRows = 5 ;
13+
14+ for (int row = 1 ; row <= totalRows ; row ++) {
15+
16+ int k = row ;
17+
18+ for (int column = row ; column <= totalRows -1 ; column ++) {
19+ System .out .print (0 + " " );
20+ }
21+
22+ // System.out.print(row);
23+ for (int column = 1 ; column <= row ; column ++) {
24+ System .out .print (k + " " );
25+ k ++;
26+ }
27+
28+ for (int column = k -2 ; column >= row ; column --) {
29+ System .out .print (column + " " );
30+ // k--;
31+ }
32+
33+ for (int column = row ; column <= totalRows -1 ; column ++) {
34+ if (column == totalRows ){
35+ System .out .print (0 );
36+ }else {
37+ System .out .print (0 + " " );
38+ }
39+ }
40+
41+ System .out .println ();
42+ }
43+ }
44+ }
Original file line number Diff line number Diff line change @@ -10,6 +10,22 @@ public static void main(String[] args) {
1010 System .out .println (output );
1111 }
1212
13+ static void firstOccurenceOfWord (String A , String B ){
14+
15+ int lengthOfString = A .length ();
16+
17+ for (int i = 0 ; i < lengthOfString ; i ++) {
18+
19+ for (int j = i +1 ; j < lengthOfString ; j ++) {
20+
21+ // if
22+
23+ }
24+
25+
26+ }
27+ }
28+
1329 static String reverseWordsInASentence (String S ){
1430
1531 String [] array = S .split (" " );
You can’t perform that action at this time.
0 commit comments