Wednesday, July 9, 2014

Pattern Display Program On Word BLUEJ


This is a pattern display program which will display the word 'BLUEJ' as
B
LL
UUU
EEEE
JJJJJ

Here is the program:

class Pat
{
 int i,j,len;
String s="BLUEJ";
len=s.length();
void show()
{
 for(i=0; i < len; i++)
{
 for(j=0;j< = i;j++)
{
 System.out.print(s.charAt(i));
}
System.out.println();
}
}
public static void main(String args[])
{
 Pat ob=new Pat();
ob.show();
}
}

Related PostBlueJ Programs On Pattern

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner