Question: fun main() { // Prompt the user to enter an integer N val n = readLine()!!.toInt() // Set variable i to 1 var i =

fun main() { // Prompt the user to enter an integer N val n = readLine()!!.toInt() // Set variable i to 1 var i = 1 // Start a while loop that continues while i is less than or equal to N while (i <= n) { // Within the while loop, start a nested for loop with variable j starting at 1 and ending at i for (j in 1..i) { // Within the nested for loop, print "*" print("*") } // Print a newline character println() // Increase i by 1 i++ } }

Not sure what im doing wrong here but I cant get an output to print

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!