public class pattern11
{
public static void main(String[] args) {
int i,j;
for(i=5; i>=1; i--)
{
System.out.print("\n");
for(j=5; j>=i; j--)
{
System.out.print(" ");
}
for(int c=1; c<=i; c++)
System.out.print(c);
}
}
}
output:
12345
1234
123
12
1
{
public static void main(String[] args) {
int i,j;
for(i=5; i>=1; i--)
{
System.out.print("\n");
for(j=5; j>=i; j--)
{
System.out.print(" ");
}
for(int c=1; c<=i; c++)
System.out.print(c);
}
}
}
output:
12345
1234
123
12
1
No comments:
Post a Comment
SAY HELLO!!