Java Pattern Programs

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