Thursday, May 1, 2014

Pattern Using Java

Display the pattern:

*
* *
* * *
* * * *
* * *
* *
*


class Pat
{
 void showPattern()
{
 int i,j,x=0;
 for(i=0;i< 7;i++)
<7 i="" p="">{
if(i<=7/2)
x++;
else
x--;
 for(j=0;j< x;j++)

<7 i="" p="">{
 System.out.print("*");
}
System.out.println();
}
}
public static void main(String args[])
{
 Pat ob=new Pat();
ob.showPattern();
}
}

<7 i="" p="">
<7 i="" p="">Related PostBlueJ Programs On Pattern

2 comments:

  1. Wap to input a number in bluej and check whether it is neon number or not

    ReplyDelete

Subscribe via email

Enter your email address:

Delivered by FeedBurner