Skip to content

Commit 0a1b427

Browse files
committed
Letter T solution added
1 parent 8788e26 commit 0a1b427

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Pattern_Printing/Letter_T.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package Pattern_Printing;
2+
3+
// Write a program to print letter T exactly as shown below -
4+
5+
public class Letter_T {
6+
// Driver code
7+
public static void main(String[] args) {
8+
// Number of lines for the Letter
9+
int height = 7;
10+
11+
int i, j;
12+
// Pattern printing
13+
for (i = 0; i < height; i++) {
14+
for (j = 0; j < height; j++) {
15+
if (i == 0)
16+
System.out.printf("$$");
17+
else if (j == height / 2)
18+
System.out.printf("@@");
19+
else
20+
System.out.printf(" ");
21+
}
22+
System.out.printf("\n");
23+
}
24+
}
25+
}
26+
27+
// Output :
28+
/*
29+
$$$$$$$$$$$$$$
30+
@@
31+
@@
32+
@@
33+
@@
34+
@@
35+
@@
36+
@@
37+
*/

0 commit comments

Comments
 (0)