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>
<7 i="" p="">{
System.out.print("*");
}
System.out.println();
}
}
public static void main(String args[])
{
Pat ob=new Pat();
ob.showPattern();
}
} 7>
<7 i="" p="">
7>
<7 i="" p="">Related Post: BlueJ Programs On Pattern 7>
*
* *
* * *
* * * *
* * *
* *
*
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>
<7 i="" p="">
System.out.print("*");
}
System.out.println();
}
}
public static void main(String args[])
{
Pat ob=new Pat();
ob.showPattern();
}
}
<7 i="" p="">
Wap to input a number in bluej and check whether it is neon number or not
ReplyDeleteProgram posted on 16 June 2014
Delete