Computer Applications
Write a program in Java to display the following pattern:
PRTV
PRT
PR
P
Java
Java Library Classes
35 Likes
Answer
public class KboatPattern
{
public static void main(String args[]) {
for (int i = 86; i >= 80; i = i - 2) {
for (int j = 80; j <= i; j = j + 2) {
System.out.print((char)j);
}
System.out.println();
}
}
}
Variable Description Table
Program Explanation
Output
Answered By
18 Likes
Related Questions
Write a program in Java to display the following pattern:
ABCDE
ABC
AWrite a program in Java to display the following pattern:
A*B*C*D*E*
A*B*C*D*
A*B*C*
A*B*
A*Write a program in Java to display the following pattern:
a a a a a
b b b b b
A A A A A
B B B B BWrite a program in Java to display the following pattern:
ZYXWU
ZYXW
ZYX
ZY
Z