Java Print Invertedtriangle
# Java Example β Print an Inverted Triangle
[ Java Examples](#)
Print an inverted triangle.
## Example
```java
public class InvertedTriangle{
public static void main(String[]args){
//Print.Inverted Triangle
for(int m = 1; m<= 4; m++){
//Print.Spaces
for(int n = 0; n<= m; n++){
System.out.print(" ");
}
//Print.*
for(int x = 1; x= 0; i--) {
for (int j = 0; j < (size - 1) - i; j++) {
System.out.print(" ");
}
for (int j = 0; j < 2 * i + 1; j++) {
System.out.print("*");
}
System.out.println();
}
}
}
[Toutiao Account[ITShepherd's Purse]](javascript:;)Toutiao Account[ITShepherd's Purse]
qux***ong@qq.com 7 years ago (2019-12-16)
### Click to Share Note
YouTip