Computer Science, asked by Sumy2315, 1 year ago

How to display alphabet pattern using java?

Answers

Answered by sanskarsworup
0



Alphabet Pattern in Java

class AlphabetsPattern { public static void main(String abc[]) { for(int i=1;i<5;i++) { int alphabet=65; //ASCII value of A for(int j=1;j<=i;j++) { System.out.print((char)alphabet); alphabet++; } System.out.println(); } } }

Output

A
AB
ABC
ABCD



hope it helps plz plz plz plz mark as BRAINLIEST
Similar questions