| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/av1nDs0uza/Java-Programs-1/master/StringPatterns/pattern26.java | [Back] [Original] |
package StringPatterns;
/*
* P M
R A
O R
G
O R
R A
P M
**/
public class pattern26 {
public static void main(String[] args) {
String str = "PROGRAM";
int x = str.length();
char[] chars = new char[x];
for (int i = 0; i < x; i++) {
chars[i] = str.charAt(i);
chars[x - 1 - i] = str.charAt(x - i - 1);
for (int j = 0; j < x; j++) {
if (j == i || j == (x - 1 - i)) {
continue;
}
chars[j] = ' ';
}
System.out.println(new String(chars));
}
}
}
| Web Proxy Viewer | New URL | Original Page |