public class equitraingle {
public static void main(String[ ] args) {
int numrows=6; // changing the value of numrows,respective o/p will be printed
for(int i=1;i<numrows;i++){
for(int j=1;j<numrows-i;j++)
{
System.out.print(" ");
}
for(int k=1;k<=i;k++){
System.out.print(k+" ");
}
System.out.println("");
}
}
}
o/p:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Chat with our AI personalities