- Home
- Studylists
Java Pattern Programs
Java Pattern Programs
Java String Handling
Write a program to generate a triangle or an inverted triangle based upon User’s choice.
Example 1:
Input: Type 1 for a triangle and
Type 2 for an inverted triangle
Enter your choice 1
Enter a word : BLUEJ
Sample Output:
B
L L
U U U
E E E E
J J J J JExample 2:
Input: Type 1 for a triangle and
Type 2 for an inverted triangle
Enter your choice 2
Enter a word : BLUEJ
Sample Output:
B L U E J
B L U E
B L U
B L
BView Answer22 Likes
Java Nested for Loops
Write a program in Java to display the following pattern:
11
12 22
13 23 33
14 24 34 44
15 25 35 45 55View Answer5 Likes
Java Nested for Loops
Write a program in Java to display the following pattern:
1 3 5 5 7 9 7 9 11 13 9 11 13 15 17
View Answer15 Likes
Java Nested for Loops
Write a program in Java to display the following pattern:
11 13 15 17 19 21
View Answer5 Likes
Java Nested for Loops
Write a program in Java to display the following pattern:
3
5 6
8 9 10
12 13 14 15View Answer10 Likes
Java Nested for Loops
Write a program in Java to display the following pattern:
1 2 3 4 5
2 2 3 4 5
3 2 3 4 5
4 2 3 4 5
5 2 3 4 5View Answer7 Likes
Java Nested for Loops
Write a program in Java to display the following pattern:
1
2 6
3 7 10
4 8 11 13
5 9 12 14 15View Answer13 Likes
Java Nested for Loops
Write a program in Java to display the following pattern:
123454321
1234321
12321
121
1View Answer6 Likes
Java Nested for Loops
Write a program in Java to display the following pattern:
5
454
34543
2345432
123454321View Answer6 Likes
Java Nested for Loops
Write a program in Java to display the following pattern:
225 196 169 144 121 100 81 64 49 36 25 16 9 4 1
View Answer8 Likes