Sunday, July 12, 2020

Java Pattern On Alternate Upper case And Lower Case Characters


A

ab

ABC

abcd

ABCDE

class Ab

{

void show()

{

 int i,j,x;

for(i=0;i<5;i++)

{

x=65;

for(j=0;j<=I;j++)

{

if(i%2==0)

System.out.print(“ “+(char)(x+j));

else

System.out.print(“ “+Character.toLowerCase((char)(x+j)));

}

}

}


No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner