{
public static void main(String ar[])
{
int row,col,patten_value=1;
for(row=1;row<=5;row++)
{
for(col=1;col<=row;col++)
{
if(col==1 || col==row)
patten_value=1;
else
patten_value=0;
System.out.print(patten_value+" ");
}
System.out.print("\n");
}
}
}
No comments:
Post a Comment