Friday, February 4, 2011

for loop demo

//demo on for statement;
class Fordemo
{
public static void main(String args[])
{
int x=1;

for(int k=10;k>=k/2;k--)
{
System.out.println(" ");
for(;x<=10;x++)
{
System.out.println();
{
for(int j=1;j<=x;++j)
System.out.print(" * ");
}
}
}
}
}

No comments:

Post a Comment