/*
print following trangle
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5 */
import java.io.*;
class simple_print_numeric_trangle_type1
{
public static void main(String args[])
{
int r=1,c;
while(r<=5)
{
c=1;
while(c<=r)
{
System.out.print(c);
System.out.print(" ");
c++;
}
System.out.println();
r++;
}
}
}
No comments:
Post a Comment