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 Post: BlueJ Programs On Pattern
No comments:
Post a Comment