Saturday, 18 July 2015

SIMPLE PROGRAMME FOR CREATING LOOP 1

programme:-for writing this loop
1
12
123
1234
12345



public class pyramid
{
public static void main(String args[])
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(j);
}
System.out.println();
}
}
}


save it by pyramid.java

No comments:

Post a Comment