series-7

 1 2 3 4 5

 2 2 3 4 5

3 3 3 4 5

4 4 4 4 5


class series

{

public static void main(String args[])

{

for(int r=1; r<=4; r++)

{

for (int c=1 ; c<=5 ; c++)

{

if(c<=r)

System.out.print(r);

else

System.out.print(c);

}

System.out.println() // to come to next line

}

}

}


Comments

Post a Comment

Popular posts from this blog