Wednesday, 11 November 2020

Write a Program to generate the following pattern

/* Pattern :

A

A B

A B C 

A B C D

A B C D E

*/

public class Pattern_2

{

public static void main(String args[])

{

int i,j;

for(i=65;i<=69;i++)

{

for(j=65;j<=i;j++)

System.out.print((char)j+" ");

System.out.println();

}

}

}

No comments:

Post a Comment

Java Program to count the total number of characters in a string

 //Java Program to count the total number of characters in a string import java.util.*; public class CountChars {     public static void mai...