Print Left Traingle Star (*) in Kotlin
Published in
Oct 1, 2019
Today we are going to print left traingle star in kotlin.
Expected Output
*
* *
* * *
* * * *
* * * * *
Below is the Program.fun main(){
leftTriangle()
}
fun leftTriangle(){
var n=4
for (i in 0 .. n){
for (j in 0.. n-i){
print(" ")
}
for (k in 0.. i){
print("*")
}
println(" ")
}
}
You can read Pyramid Traingle here